diff --git a/components/tinyusb/CMakeLists.txt b/components/tinyusb/CMakeLists.txt index 854a7e7378..5e90277ec2 100644 --- a/components/tinyusb/CMakeLists.txt +++ b/components/tinyusb/CMakeLists.txt @@ -53,10 +53,13 @@ if(CONFIG_TINYUSB) "tinyusb/src/tusb.c" "additions/src/descriptors_control.c" "additions/src/tinyusb.c" - "additions/src/tusb_tasks.c" "additions/src/usb_descriptors.c" ) + if(NOT CONFIG_TINYUSB_NO_DEFAULT_TASK) + list(APPEND srcs "additions/src/tusb_tasks.c") + endif() + # when no builtin class driver is enabled, an uint8_t data compared with `BUILTIN_DRIVER_COUNT` will always be false set_source_files_properties("tinyusb/src/device/usbd.c" PROPERTIES COMPILE_FLAGS "-Wno-type-limits") diff --git a/components/tinyusb/additions/src/tusb_tasks.c b/components/tinyusb/additions/src/tusb_tasks.c index 2044382079..bf0681db54 100644 --- a/components/tinyusb/additions/src/tusb_tasks.c +++ b/components/tinyusb/additions/src/tusb_tasks.c @@ -12,8 +12,6 @@ #include "tinyusb.h" #include "tusb_tasks.h" -#if !CONFIG_TINYUSB_NO_DEFAULT_TASK - const static char *TAG = "tusb_tsk"; static TaskHandle_t s_tusb_tskh; @@ -46,5 +44,3 @@ esp_err_t tusb_stop_task(void) s_tusb_tskh = NULL; return ESP_OK; } - -#endif // !CONFIG_TINYUSB_NO_DEFAULT_TASK