touch_sensor: make touch_element compile on esp32s3

Closes: https://github.com/espressif/esp-idf/issues/9292
This commit is contained in:
wangyuanze 2022-07-28 12:19:07 +08:00
parent 6658b7eb0a
commit 4a617e459a
8 changed files with 22 additions and 31 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)