mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-08-17 23:55:04 +00:00
Fixes and cleanup
This commit is contained in:
parent
a96fd77986
commit
26a8aa26c2
@ -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
|
||||
)
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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", "")
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user