-
-
Notifications
You must be signed in to change notification settings - Fork 82
Fix for LilyGO T-HMI SD card #515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
36db476
1a6cc81
e7e8c50
8400d37
aa954da
4d245d4
48f9ed4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,4 +14,22 @@ macro(tactility_project project_name) | |||||||||||||||||||||||
| if (NOT "$ENV{ESP_IDF_VERSION}" STREQUAL "${TACTILITY_SDK_IDF_VERSION}") | ||||||||||||||||||||||||
| message(FATAL_ERROR "ESP-IDF version of Tactility SDK (${TACTILITY_SDK_IDF_VERSION}) does not match current ESP-IDF version ($ENV{ESP_IDF_VERSION})") | ||||||||||||||||||||||||
| endif() | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| set(EXTRA_COMPONENT_DIRS | ||||||||||||||||||||||||
| "Libraries/TactilityFreeRtos" | ||||||||||||||||||||||||
| "Modules" | ||||||||||||||||||||||||
| "Drivers" | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| set(COMPONENTS | ||||||||||||||||||||||||
| TactilityFreeRtos | ||||||||||||||||||||||||
| bm8563-module | ||||||||||||||||||||||||
| bm8563-module | ||||||||||||||||||||||||
|
Comment on lines
+26
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate entry: Lines 26 and 27 both include 🐛 Proposed fix set(COMPONENTS
TactilityFreeRtos
bm8563-module
- bm8563-module
bmi270-module
mpu6886-module
pi4ioe5v6408-module
qmi8658-module
rx8130ce-module
)📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||
| bmi270-module | ||||||||||||||||||||||||
| mpu6886-module | ||||||||||||||||||||||||
| pi4ioe5v6408-module | ||||||||||||||||||||||||
| qmi8658-module | ||||||||||||||||||||||||
| rx8130ce-module | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| endmacro() | ||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |||||||||||||||||||||||||||||||||||
| import glob | ||||||||||||||||||||||||||||||||||||
| import subprocess | ||||||||||||||||||||||||||||||||||||
| import sys | ||||||||||||||||||||||||||||||||||||
| from textwrap import dedent | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| def map_copy(mappings, target_base): | ||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||
|
|
@@ -59,6 +60,45 @@ def map_copy(mappings, target_base): | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| os.makedirs(os.path.dirname(final_dst), exist_ok=True) | ||||||||||||||||||||||||||||||||||||
| shutil.copy2(src, final_dst) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| def get_driver_mappings(driver_name): | ||||||||||||||||||||||||||||||||||||
| return [ | ||||||||||||||||||||||||||||||||||||
| {'src': f'Drivers/{driver_name}/include/**', 'dst': f'Drivers/{driver_name}/include/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': f'Drivers/{driver_name}/*.md', 'dst': f'Drivers/{driver_name}/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': f'build/esp-idf/{driver_name}/lib{driver_name}.a', 'dst': f'Drivers/{driver_name}/binary/lib{driver_name}.a'}, | ||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| def get_module_mappings(module_name): | ||||||||||||||||||||||||||||||||||||
| return [ | ||||||||||||||||||||||||||||||||||||
| {'src': f'Modules/{module_name}/include/**', 'dst': f'Modules/{module_name}/include/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': f'Modules/{module_name}/*.md', 'dst': f'Modules/{module_name}/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': f'build/esp-idf/{module_name}/lib{module_name}.a', 'dst': f'Modules/{module_name}/binary/lib{module_name}.a'}, | ||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| def create_module_cmakelists(module_name): | ||||||||||||||||||||||||||||||||||||
| return dedent(f''' | ||||||||||||||||||||||||||||||||||||
| cmake_minimum_required(VERSION 3.20) | ||||||||||||||||||||||||||||||||||||
| idf_component_register( | ||||||||||||||||||||||||||||||||||||
| INCLUDE_DIRS "include" | ||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||
| add_prebuilt_library({module_name} "binary/lib{module_name}.a") | ||||||||||||||||||||||||||||||||||||
| '''.format(module_name=module_name)) | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+78
to
+85
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redundant
🐛 Proposed fix def create_module_cmakelists(module_name):
return dedent(f'''
cmake_minimum_required(VERSION 3.20)
idf_component_register(
INCLUDE_DIRS "include"
)
add_prebuilt_library({module_name} "binary/lib{module_name}.a")
- '''.format(module_name=module_name))
+ target_link_libraries(${{COMPONENT_LIB}} INTERFACE {module_name})
+ ''')Note: 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| def write_module_cmakelists(path, content): | ||||||||||||||||||||||||||||||||||||
| with open(path, 'w') as f: | ||||||||||||||||||||||||||||||||||||
| f.write(content) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| def add_driver(target_path, driver_name): | ||||||||||||||||||||||||||||||||||||
| mappings = get_driver_mappings(driver_name) | ||||||||||||||||||||||||||||||||||||
| map_copy(mappings, target_path) | ||||||||||||||||||||||||||||||||||||
| cmakelists_content = create_module_cmakelists(driver_name) | ||||||||||||||||||||||||||||||||||||
| write_module_cmakelists(os.path.join(target_path, f"Drivers/{driver_name}/CMakeLists.txt"), cmakelists_content) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| def add_module(target_path, module_name): | ||||||||||||||||||||||||||||||||||||
| mappings = get_module_mappings(module_name) | ||||||||||||||||||||||||||||||||||||
| map_copy(mappings, target_path) | ||||||||||||||||||||||||||||||||||||
| cmakelists_content = create_module_cmakelists(module_name) | ||||||||||||||||||||||||||||||||||||
| write_module_cmakelists(os.path.join(target_path, f"Modules/{module_name}/CMakeLists.txt"), cmakelists_content) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| def main(): | ||||||||||||||||||||||||||||||||||||
| if len(sys.argv) < 2: | ||||||||||||||||||||||||||||||||||||
|
|
@@ -85,12 +125,7 @@ def main(): | |||||||||||||||||||||||||||||||||||
| {'src': 'build/esp-idf/TactilityKernel/libTactilityKernel.a', 'dst': 'Libraries/TactilityKernel/binary/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': 'TactilityKernel/include/**', 'dst': 'Libraries/TactilityKernel/include/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': 'TactilityKernel/CMakeLists.txt', 'dst': 'Libraries/TactilityKernel/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': 'TactilityKernel/LICENSE*.*', 'dst': 'Libraries/TactilityKernel/'}, | ||||||||||||||||||||||||||||||||||||
| # lvgl-module | ||||||||||||||||||||||||||||||||||||
| {'src': 'build/esp-idf/lvgl-module/liblvgl-module.a', 'dst': 'Libraries/lvgl-module/binary/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': 'Modules/lvgl-module/include/**', 'dst': 'Libraries/lvgl-module/include/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': 'Modules/lvgl-module/CMakeLists.txt', 'dst': 'Libraries/lvgl-module/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': 'Modules/lvgl-module/LICENSE*.*', 'dst': 'Libraries/lvgl-module/'}, | ||||||||||||||||||||||||||||||||||||
| {'src': 'TactilityKernel/*.md', 'dst': 'Libraries/TactilityKernel/'}, | ||||||||||||||||||||||||||||||||||||
| # lvgl (basics) | ||||||||||||||||||||||||||||||||||||
| {'src': 'build/esp-idf/lvgl__lvgl/liblvgl__lvgl.a', 'dst': 'Libraries/lvgl/binary/liblvgl.a'}, | ||||||||||||||||||||||||||||||||||||
| {'src': 'Libraries/lvgl/lvgl.h', 'dst': 'Libraries/lvgl/include/'}, | ||||||||||||||||||||||||||||||||||||
|
|
@@ -108,6 +143,18 @@ def main(): | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| map_copy(mappings, target_path) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # Modules | ||||||||||||||||||||||||||||||||||||
| add_module(target_path, "lvgl-module") | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # Drivers | ||||||||||||||||||||||||||||||||||||
| add_driver(target_path, "bm8563-module") | ||||||||||||||||||||||||||||||||||||
| add_driver(target_path, "bm8563-module") | ||||||||||||||||||||||||||||||||||||
| add_driver(target_path, "bmi270-module") | ||||||||||||||||||||||||||||||||||||
| add_driver(target_path, "mpu6886-module") | ||||||||||||||||||||||||||||||||||||
| add_driver(target_path, "pi4ioe5v6408-module") | ||||||||||||||||||||||||||||||||||||
| add_driver(target_path, "qmi8658-module") | ||||||||||||||||||||||||||||||||||||
| add_driver(target_path, "rx8130ce-module") | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+149
to
+156
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate entry: Lines 150-151 both call 🐛 Proposed fix # Drivers
add_driver(target_path, "bm8563-module")
- add_driver(target_path, "bm8563-module")
add_driver(target_path, "bmi270-module")
add_driver(target_path, "mpu6886-module")
add_driver(target_path, "pi4ioe5v6408-module")
add_driver(target_path, "qmi8658-module")
add_driver(target_path, "rx8130ce-module")📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # Output ESP-IDF SDK version to file | ||||||||||||||||||||||||||||||||||||
| esp_idf_version = os.environ.get("ESP_IDF_VERSION", "") | ||||||||||||||||||||||||||||||||||||
| with open(os.path.join(target_path, "idf-version.txt"), "a") as f: | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| dependencies: | ||
| - Platforms/platform-esp32 | ||
| # Add all driver modules because the generic devices are used to build the SDK | ||
| - Drivers/bm8563-module | ||
| - Drivers/bmi270-module | ||
| - Drivers/mpu6886-module | ||
| - Drivers/pi4ioe5v6408-module | ||
| - Drivers/qmi8658-module | ||
| - Drivers/rx8130ce-module | ||
| dts: generic,esp32.dts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| dependencies: | ||
| - Platforms/platform-esp32 | ||
| # Add all driver modules because the generic devices are used to build the SDK | ||
| - Drivers/bm8563-module | ||
| - Drivers/bmi270-module | ||
| - Drivers/mpu6886-module | ||
| - Drivers/pi4ioe5v6408-module | ||
| - Drivers/qmi8658-module | ||
| - Drivers/rx8130ce-module | ||
| dts: generic,esp32c6.dts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| dependencies: | ||
| - Platforms/platform-esp32 | ||
| # Add all driver modules because the generic devices are used to build the SDK | ||
| - Drivers/bm8563-module | ||
| - Drivers/bmi270-module | ||
| - Drivers/mpu6886-module | ||
| - Drivers/pi4ioe5v6408-module | ||
| - Drivers/qmi8658-module | ||
| - Drivers/rx8130ce-module | ||
| dts: generic,esp32p4.dts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| dependencies: | ||
| - Platforms/platform-esp32 | ||
| # Add all driver modules because the generic devices are used to build the SDK | ||
| - Drivers/bm8563-module | ||
| - Drivers/bmi270-module | ||
| - Drivers/mpu6886-module | ||
| - Drivers/pi4ioe5v6408-module | ||
| - Drivers/qmi8658-module | ||
| - Drivers/rx8130ce-module | ||
| dts: generic,esp32s3.dts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,5 +29,6 @@ | |
| pin-cmd = <&gpio0 11 GPIO_FLAG_NONE>; | ||
| pin-d0 = <&gpio0 13 GPIO_FLAG_NONE>; | ||
| bus-width = <1>; | ||
| pullups; | ||
| }; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,12 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake) | |
| if (DEFINED ENV{TACTILITY_SDK_PATH}) | ||
| set(TACTILITY_SDK_PATH $ENV{TACTILITY_SDK_PATH}) | ||
| else() | ||
| set(TACTILITY_SDK_PATH "../../release/TactilitySDK") | ||
| message(WARNING "⚠️ TACTILITY_SDK_PATH environment variable is not set, defaulting to ${TACTILITY_SDK_PATH}") | ||
| set(TACTILITY_SDK_PATH ../../release/TactilitySDK) | ||
| message(WARNING "TACTILITY_SDK_PATH environment variable is not set, defaulting to ${TACTILITY_SDK_PATH}") | ||
| endif() | ||
|
|
||
| include("${TACTILITY_SDK_PATH}/TactilitySDK.cmake") | ||
| set(EXTRA_COMPONENT_DIRS ${TACTILITY_SDK_PATH}) | ||
| set(EXTRA_COMPONENT_DIRS ${TACTILITY_SDK_PATH} ${TACTILITY_SDK_PATH}/Modules ${TACTILITY_SDK_PATH}/Drivers) | ||
|
|
||
| project(SdkTest) | ||
| tactility_project(SdkTest) | ||
|
Comment on lines
+13
to
16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 13 sets Consider either:
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,6 +24,14 @@ | |||||||||||
|
|
||||||||||||
| #include <tactility/lvgl_module.h> | ||||||||||||
|
|
||||||||||||
| #include <drivers/bm8563.h> | ||||||||||||
| #include <drivers/bmi270.h> | ||||||||||||
| #include <drivers/mpu6886.h> | ||||||||||||
| #include <drivers/mpu6886.h> | ||||||||||||
|
Comment on lines
+29
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate include: Lines 29 and 30 both include 🐛 Proposed fix `#include` <drivers/bmi270.h>
`#include` <drivers/mpu6886.h>
-#include <drivers/mpu6886.h>
`#include` <drivers/pi4ioe5v6408.h>📝 Committable suggestion
Suggested change
|
||||||||||||
| #include <drivers/pi4ioe5v6408.h> | ||||||||||||
| #include <drivers/qmi8658.h> | ||||||||||||
| #include <drivers/rx8130ce.h> | ||||||||||||
|
|
||||||||||||
| static void onShowApp(AppHandle app, void* data, lv_obj_t* parent) { | ||||||||||||
| lv_obj_t* toolbar = tt_lvgl_toolbar_create_for_app(parent, app); | ||||||||||||
| lv_obj_align(toolbar, LV_ALIGN_TOP_MID, 0, 0); | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relative paths in
EXTRA_COMPONENT_DIRSmay not resolve correctly.The paths set here (
Libraries/TactilityFreeRtos,Modules,Drivers) are relative but don't use${TACTILITY_SDK_PATH}as a base. When the macro is invoked from an SDK consumer project, these paths will be resolved relative to the consumer's project directory rather than the SDK directory.🐛 Proposed fix
📝 Committable suggestion