From 26a8aa26c25412a88f9c08471e327de0874c526c Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Sat, 8 Aug 2026 22:41:52 +0200 Subject: [PATCH] Fixes and cleanup --- Buildscripts/TactilitySDK/CMakeLists.txt | 1 - Buildscripts/TactilitySDK/TactilitySDK.cmake | 2 - Buildscripts/release-sdk.py | 51 +++----------------- Documentation/ideas.md | 2 + Tests/SdkIntegration/main/CMakeLists.txt | 8 +-- 5 files changed, 10 insertions(+), 54 deletions(-) diff --git a/Buildscripts/TactilitySDK/CMakeLists.txt b/Buildscripts/TactilitySDK/CMakeLists.txt index 36967944f..6fd65e2a8 100644 --- a/Buildscripts/TactilitySDK/CMakeLists.txt +++ b/Buildscripts/TactilitySDK/CMakeLists.txt @@ -7,7 +7,6 @@ idf_component_register( "Libraries/minmea/include" "Libraries/minitar/include" "Modules/lvgl-module/include" - # DRIVER_INCLUDE_DIRS_PLACEHOLDER REQUIRES esp_timer app-module crypt-module gps-module lvgl-module lvgl-window-manager-module service-module ) diff --git a/Buildscripts/TactilitySDK/TactilitySDK.cmake b/Buildscripts/TactilitySDK/TactilitySDK.cmake index eb3c64682..fe60e8c7c 100644 --- a/Buildscripts/TactilitySDK/TactilitySDK.cmake +++ b/Buildscripts/TactilitySDK/TactilitySDK.cmake @@ -20,7 +20,6 @@ macro(tactility_project project_name) set(EXTRA_COMPONENT_DIRS "${TACTILITY_SDK_PATH}/Libraries/TactilityFreeRtos" "${TACTILITY_SDK_PATH}/Modules" - "${TACTILITY_SDK_PATH}/Drivers" ) set(COMPONENTS @@ -31,7 +30,6 @@ macro(tactility_project project_name) lvgl-module lvgl-window-manager-module service-module - # DRIVER_COMPONENTS_PLACEHOLDER ) endmacro() diff --git a/Buildscripts/release-sdk.py b/Buildscripts/release-sdk.py index 259426aa3..c530a4520 100644 --- a/Buildscripts/release-sdk.py +++ b/Buildscripts/release-sdk.py @@ -111,43 +111,13 @@ def add_module(target_path, module_name): cmakelists_content = create_module_cmakelists(module_name) write_module_cmakelists(os.path.join(target_path, f"Modules/{module_name}/CMakeLists.txt"), cmakelists_content) -def discover_all_drivers(): - """ - Discover all *-module directories under Drivers/ (not Modules/ - those are handled - separately via add_module). Sorted for deterministic output across OS/filesystem order. - """ - pattern = os.path.join('Drivers', '*-module') - return sorted( - os.path.basename(p) for p in glob.glob(pattern) if os.path.isdir(p) - ) - -def generate_tactility_sdk_cmake(target_path, available_drivers): +def generate_tactility_sdk_cmake(target_path): src = os.path.join('Buildscripts', 'TactilitySDK', 'TactilitySDK.cmake') - with open(src) as f: - content = f.read() - placeholder = " # DRIVER_COMPONENTS_PLACEHOLDER" - assert placeholder in content, \ - f"Placeholder '{placeholder.strip()}' not found in {src} - template drifted, generator needs updating" - components = "\n".join(f" {d}" for d in available_drivers) - new_content = content.replace(placeholder, components) - assert placeholder not in new_content, \ - f"Placeholder '{placeholder.strip()}' still present after replacement in {src}" - with open(os.path.join(target_path, 'TactilitySDK.cmake'), 'w') as f: - f.write(new_content) + shutil.copy2(src, os.path.join(target_path, 'TactilitySDK.cmake')) -def generate_tactility_sdk_top_cmakelists(target_path, available_drivers): +def generate_tactility_sdk_top_cmakelists(target_path): src = os.path.join('Buildscripts', 'TactilitySDK', 'CMakeLists.txt') - with open(src) as f: - content = f.read() - placeholder = " # DRIVER_INCLUDE_DIRS_PLACEHOLDER" - assert placeholder in content, \ - f"Placeholder '{placeholder.strip()}' not found in {src} - template drifted, generator needs updating" - include_dirs = "\n".join(f' "Drivers/{d}/include"' for d in available_drivers) - new_content = content.replace(placeholder, include_dirs) - assert placeholder not in new_content, \ - f"Placeholder '{placeholder.strip()}' still present after replacement in {src}" - with open(os.path.join(target_path, 'CMakeLists.txt'), 'w') as f: - f.write(new_content) + shutil.copy2(src, os.path.join(target_path, 'CMakeLists.txt')) def main(): if len(sys.argv) < 2: @@ -208,16 +178,9 @@ def main(): add_module(target_path, "lvgl-window-manager-module") add_module(target_path, "service-module") - # Drivers - only ones actually built for this target (chip-restricted drivers like - # sc2356-module won't have a .a outside ESP32-P4) - available_drivers = [d for d in discover_all_drivers() if driver_is_available(d)] - for driver_name in available_drivers: - add_driver(target_path, driver_name) - - # Final scripts - generated (not copied verbatim) so COMPONENTS/INCLUDE_DIRS only list - # drivers actually available for this target - generate_tactility_sdk_cmake(target_path, available_drivers) - generate_tactility_sdk_top_cmakelists(target_path, available_drivers) + # Final scripts - copied verbatim + generate_tactility_sdk_cmake(target_path) + generate_tactility_sdk_top_cmakelists(target_path) # Output ESP-IDF SDK version to file esp_idf_version = os.environ.get("ESP_IDF_VERSION", "") diff --git a/Documentation/ideas.md b/Documentation/ideas.md index c1e06e060..e8940ad5d 100644 --- a/Documentation/ideas.md +++ b/Documentation/ideas.md @@ -12,6 +12,7 @@ ## Higher Priority +- Make it more clear to end-users that an SD card is required to run Tactility - Move "# Fix error "PSRAM space not enough for the Flash instructions" on boot:" fix from T-Deck and others to device.py - Make it possible to override stack size for an app via config file (loaded at boot), and make it possible to set preferred memory location (e.g. internal/external) - Put task stacks in PSRAM when possible. @@ -52,6 +53,7 @@ ## Medium Priority +- Consider moving certain drivers into separate modules: audio, bt, wifi, etc - Consider using https://github.com/Graphify-Labs/graphify - Consider implementing LVGL gridnav in apps https://lvgl.io/docs/open/9.3/details/auxiliary-modules/gridnav.html - Implement a LED kernel driver (single colour and RGB, plain GPIO and PWM) diff --git a/Tests/SdkIntegration/main/CMakeLists.txt b/Tests/SdkIntegration/main/CMakeLists.txt index 3e247cf3d..29dce1869 100644 --- a/Tests/SdkIntegration/main/CMakeLists.txt +++ b/Tests/SdkIntegration/main/CMakeLists.txt @@ -3,11 +3,5 @@ file(GLOB_RECURSE SOURCE_FILES Source/*.c) idf_component_register( SRCS ${SOURCE_FILES} REQUIRES TactilitySDK - lvgl-module - bm8563-module - bmi270-module - mpu6886-module - pi4ioe5v6408-module - qmi8658-module - rx8130ce-module + app-module crypt-module gps-module lvgl-module lvgl-window-manager-module service-module )