Implemented TactilityKernel and DevicetreeCompiler, updated licenses & copyrights (#452)

**New features**

- Created a devicetree DTS and YAML parser in Python
- Created new modules:
  - TactilityKernel (LGPL v3.0 license)
  - Platforms/PlatformEsp32 (LGPL v3.0 license) 
  - Platforms/PlatformPosix (LGPL v3.0 license)
  - Tests/TactilityKernelTests

Most boards have a placeholder DTS file, while T-Lora Pager has a few devices attached.

**Licenses**

Clarified licenses and copyrights better.

- Add explanation about the intent behind them.
- Added explanation about licenses for past and future subprojects
- Added more details explanations with regards to the logo usage
- Copied licenses to subprojects to make it more explicit
This commit is contained in:
Ken Van Hoeylandt
2026-01-24 15:47:11 +01:00
committed by GitHub
parent 0d16eb606f
commit 4b6ed871a9
194 changed files with 7807 additions and 741 deletions
+1
View File
@@ -0,0 +1 @@
Generated/
+41 -11
View File
@@ -2,28 +2,58 @@ cmake_minimum_required(VERSION 3.20)
file(GLOB_RECURSE SOURCE_FILES "Source/*.c*")
# For Generate target below
if (DEFINED ENV{ESP_IDF_VERSION})
# Read device id/project
include("../Buildscripts/device.cmake")
init_tactility_globals("../sdkconfig")
get_property(TACTILITY_DEVICE_PROJECT GLOBAL PROPERTY TACTILITY_DEVICE_PROJECT)
else ()
set(TACTILITY_DEVICE_ID simulator)
set(COMPONENT_LIB FirmwareSim)
endif ()
set(DEVICETREE_LOCATION "${CMAKE_SOURCE_DIR}/Devices/${TACTILITY_DEVICE_ID}")
if (DEFINED ENV{ESP_IDF_VERSION})
idf_component_register(
SRCS ${SOURCE_FILES}
REQUIRES ${DEVICE_COMPONENTS}
REQUIRES Tactility TactilityC ${TACTILITY_DEVICE_PROJECT}
SRCS ${SOURCE_FILES} "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c"
REQUIRES Tactility TactilityC TactilityKernel PlatformEsp32 ${TACTILITY_DEVICE_PROJECT}
)
else ()
add_executable(FirmwareSim ${SOURCE_FILES})
target_link_libraries(FirmwareSim
PRIVATE Tactility
PRIVATE TactilityCore
PRIVATE TactilityFreeRtos
PRIVATE Simulator
PRIVATE SDL2::SDL2-static SDL2-static
add_executable(FirmwareSim ${SOURCE_FILES} "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c")
target_link_libraries(FirmwareSim PRIVATE
Tactility
TactilityCore
TactilityFreeRtos
TactilityKernel
Simulator
PlatformPosix
SDL2::SDL2-static SDL2-static
)
add_definitions(-D_Nullable=)
add_definitions(-D_Nonnull=)
endif ()
file(MAKE_DIRECTORY "${CMAKE_SOURCE_DIR}/Firmware/Generated")
# Generate devicetree code and attach to Firmware component
add_custom_command(
OUTPUT "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c"
"${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.h"
COMMAND pip install lark pyyaml
COMMAND python "${CMAKE_SOURCE_DIR}/Buildscripts/DevicetreeCompiler/compile.py"
"${DEVICETREE_LOCATION}" "Firmware/Generated"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
DEPENDS "${DEVICETREE_LOCATION}/devicetree.yaml" # Optional: trigger rebuild if source changes
COMMENT "Generating devicetree source files..."
)
add_custom_target(Generated DEPENDS "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c")
set_source_files_properties("${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c" PROPERTIES GENERATED TRUE)
set_source_files_properties("${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.h" PROPERTIES GENERATED TRUE)
# Update target for generated code
target_sources(${COMPONENT_LIB} PRIVATE "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c")
target_include_directories(${COMPONENT_LIB} PRIVATE "${CMAKE_SOURCE_DIR}/Firmware/Generated")
+12
View File
@@ -1,5 +1,8 @@
#include <Tactility/Tactility.h>
#include <Tactility/Driver.h>
#include <devicetree.h>
#ifdef ESP_PLATFORM
#include <tt_init.h>
#else
@@ -11,6 +14,10 @@ extern const tt::hal::Configuration hardwareConfiguration;
extern "C" {
extern void register_kernel_drivers();
extern void register_platform_drivers();
extern void register_device_drivers();
void app_main() {
static const tt::Configuration config = {
/**
@@ -24,6 +31,11 @@ void app_main() {
tt_init_tactility_c(); // ELF bindings for side-loading on ESP32
#endif
register_kernel_drivers();
register_platform_drivers();
register_device_drivers();
devices_builtin_init();
tt::run(config);
}