diff --git a/components/touch_element/CMakeLists.txt b/components/touch_element/CMakeLists.txt index 790d67352e..21a54d5aad 100644 --- a/components/touch_element/CMakeLists.txt +++ b/components/touch_element/CMakeLists.txt @@ -1,4 +1,6 @@ -if(IDF_TARGET STREQUAL "esp32s2") +set(TOUCH_ELEMENT_COMPATIBLE_TARGETS "esp32s2" "esp32s3") + +if(IDF_TARGET IN_LIST TOUCH_ELEMENT_COMPATIBLE_TARGETS) idf_component_register(SRCS "touch_element.c" "touch_button.c" "touch_slider.c" diff --git a/components/touch_element/test/CMakeLists.txt b/components/touch_element/test/CMakeLists.txt index fbdfd322bd..432e19c434 100644 --- a/components/touch_element/test/CMakeLists.txt +++ b/components/touch_element/test/CMakeLists.txt @@ -1,4 +1,6 @@ -if(IDF_TARGET STREQUAL "esp32s2") +set(TOUCH_ELEMENT_COMPATIBLE_TARGETS "esp32s2" "esp32s3") + +if(IDF_TARGET IN_LIST TOUCH_ELEMENT_COMPATIBLE_TARGETS) idf_component_register(SRCS "test_touch_element.c" "test_touch_button.c" "test_touch_slider.c" diff --git a/components/touch_element/touch_slider.c b/components/touch_element/touch_slider.c index 3fba3a87af..ad2b13924e 100644 --- a/components/touch_element/touch_slider.c +++ b/components/touch_element/touch_slider.c @@ -280,6 +280,8 @@ static esp_err_t slider_object_set_threshold(void) return ret; } +// workaround for compilation error on xtensa-esp32s3-elf-gcc (crosstool-NG esp-2022r1-RC1) 11.2.0 (IDF-5725) +__attribute__((optimize("-Os"))) static void slider_object_process_state(void) { te_slider_handle_list_t *item; diff --git a/examples/peripherals/touch_sensor/touch_element/touch_button/main/CMakeLists.txt b/examples/peripherals/touch_sensor/touch_element/touch_button/main/CMakeLists.txt index 6d2761b275..64e4f4dd82 100644 --- a/examples/peripherals/touch_sensor/touch_element/touch_button/main/CMakeLists.txt +++ b/examples/peripherals/touch_sensor/touch_element/touch_button/main/CMakeLists.txt @@ -1,6 +1,3 @@ -if(IDF_TARGET STREQUAL "esp32s2") - idf_component_register(SRCS "touch_button_example_main.c" - INCLUDE_DIRS ".") -else() - message(FATAL_ERROR "Touch button example only available on esp32s2 now") -endif() +idf_component_register(SRCS "touch_button_example_main.c" + INCLUDE_DIRS "." + PRIV_REQUIRES touch_element) diff --git a/examples/peripherals/touch_sensor/touch_element/touch_element_waterproof/main/CMakeLists.txt b/examples/peripherals/touch_sensor/touch_element/touch_element_waterproof/main/CMakeLists.txt index 59fccea35d..df1acc5837 100644 --- a/examples/peripherals/touch_sensor/touch_element/touch_element_waterproof/main/CMakeLists.txt +++ b/examples/peripherals/touch_sensor/touch_element/touch_element_waterproof/main/CMakeLists.txt @@ -1,6 +1,3 @@ -if(IDF_TARGET STREQUAL "esp32s2") idf_component_register(SRCS "waterproof_example_main.c" - INCLUDE_DIRS ".") -else() - message(FATAL_ERROR "Touch element waterproof example only available on esp32s2 now") -endif() + INCLUDE_DIRS "." + PRIV_REQUIRES touch_element) diff --git a/examples/peripherals/touch_sensor/touch_element/touch_elements_combination/main/CMakeLists.txt b/examples/peripherals/touch_sensor/touch_element/touch_elements_combination/main/CMakeLists.txt index a020447963..a768337bd2 100644 --- a/examples/peripherals/touch_sensor/touch_element/touch_elements_combination/main/CMakeLists.txt +++ b/examples/peripherals/touch_sensor/touch_element/touch_elements_combination/main/CMakeLists.txt @@ -1,6 +1,3 @@ -if(IDF_TARGET STREQUAL "esp32s2") - idf_component_register(SRCS "touch_elements_example_main.c" - INCLUDE_DIRS ".") -else() - message(FATAL_ERROR "Touch elements combination example only available on esp32s2 now") -endif() +idf_component_register(SRCS "touch_elements_example_main.c" + INCLUDE_DIRS "." + PRIV_REQUIRES touch_element) diff --git a/examples/peripherals/touch_sensor/touch_element/touch_matrix/main/CMakeLists.txt b/examples/peripherals/touch_sensor/touch_element/touch_matrix/main/CMakeLists.txt index 751fc932f7..ca3814e9f0 100644 --- a/examples/peripherals/touch_sensor/touch_element/touch_matrix/main/CMakeLists.txt +++ b/examples/peripherals/touch_sensor/touch_element/touch_matrix/main/CMakeLists.txt @@ -1,6 +1,3 @@ -if(IDF_TARGET STREQUAL "esp32s2") - idf_component_register(SRCS "touch_matrix_example_main.c" - INCLUDE_DIRS ".") -else() - message(FATAL_ERROR "Touch matrix example only available on esp32s2 now") -endif() +idf_component_register(SRCS "touch_matrix_example_main.c" + INCLUDE_DIRS "." + PRIV_REQUIRES touch_element) diff --git a/examples/peripherals/touch_sensor/touch_element/touch_slider/main/CMakeLists.txt b/examples/peripherals/touch_sensor/touch_element/touch_slider/main/CMakeLists.txt index 4a3a3a411e..8742ecf28c 100644 --- a/examples/peripherals/touch_sensor/touch_element/touch_slider/main/CMakeLists.txt +++ b/examples/peripherals/touch_sensor/touch_element/touch_slider/main/CMakeLists.txt @@ -1,6 +1,3 @@ -if(IDF_TARGET STREQUAL "esp32s2") - idf_component_register(SRCS "touch_slider_example_main.c" - INCLUDE_DIRS ".") -else() - message(FATAL_ERROR "Touch slider example only available on esp32s2 now") -endif() +idf_component_register(SRCS "touch_slider_example_main.c" + INCLUDE_DIRS "." + PRIV_REQUIRES touch_element)