diff --git a/tools/sdk/esp32s2/include/config/sdkconfig.h b/tools/sdk/esp32s2/include/config/sdkconfig.h index df5fd16d..35519c02 100644 --- a/tools/sdk/esp32s2/include/config/sdkconfig.h +++ b/tools/sdk/esp32s2/include/config/sdkconfig.h @@ -355,8 +355,6 @@ #define CONFIG_SPIFFS_USE_MTIME 1 #define CONFIG_USB_ENABLED 1 #define CONFIG_USB_MAX_POWER_USAGE 100 -#define CONFIG_USB_DYNAMIC_DRIVER_LOADING 1 -#define CONFIG_USB_DYNAMIC_DRIVER_MAX 16 #define CONFIG_USB_CDC_ENABLED 1 #define CONFIG_USB_CDC_RX_BUFSIZE 64 #define CONFIG_USB_CDC_TX_BUFSIZE 64 @@ -364,7 +362,7 @@ #define CONFIG_USB_MSC_ENABLED 1 #define CONFIG_USB_MSC_BUFSIZE 512 #define CONFIG_USB_HID_ENABLED 1 -#define CONFIG_USB_HID_BUFSIZE 16 +#define CONFIG_USB_HID_BUFSIZE 64 #define CONFIG_USB_MIDI_ENABLED 1 #define CONFIG_USB_MIDI_RX_BUFSIZE 64 #define CONFIG_USB_MIDI_TX_BUFSIZE 64 diff --git a/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/osal/osal_freertos.h b/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/osal/osal_freertos.h index 42ea1fd1..416065ee 100644 --- a/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/osal/osal_freertos.h +++ b/tools/sdk/esp32s2/include/tinyusb/tinyusb/src/osal/osal_freertos.h @@ -32,6 +32,7 @@ #include "semphr.h" #include "queue.h" #include "task.h" +#include "tusb_option.h" #ifdef __cplusplus extern "C" { @@ -58,7 +59,19 @@ static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semde static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr) { - return in_isr ? xSemaphoreGiveFromISR(sem_hdl, NULL) : xSemaphoreGive(sem_hdl); + if(!in_isr){ + return xSemaphoreGive(sem_hdl) != 0; + } + BaseType_t xHigherPriorityTaskWoken; + BaseType_t res = xSemaphoreGiveFromISR(sem_hdl, &xHigherPriorityTaskWoken); +#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 + if (xHigherPriorityTaskWoken) { + portYIELD_FROM_ISR(); + } +#else + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); +#endif + return res != 0; } static inline bool osal_semaphore_wait (osal_semaphore_t sem_hdl, uint32_t msec) @@ -125,7 +138,19 @@ static inline bool osal_queue_receive(osal_queue_t qhdl, void* data) static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr) { - return in_isr ? xQueueSendToBackFromISR(qhdl, data, NULL) : xQueueSendToBack(qhdl, data, OSAL_TIMEOUT_WAIT_FOREVER); + if(!in_isr){ + return xQueueSendToBack(qhdl, data, OSAL_TIMEOUT_WAIT_FOREVER) != 0; + } + BaseType_t xHigherPriorityTaskWoken; + BaseType_t res = xQueueSendToBackFromISR(qhdl, data, &xHigherPriorityTaskWoken); +#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 + if (xHigherPriorityTaskWoken) { + portYIELD_FROM_ISR(); + } +#else + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); +#endif + return res != 0; } static inline bool osal_queue_empty(osal_queue_t qhdl) diff --git a/tools/sdk/esp32s2/lib/libtinyusb.a b/tools/sdk/esp32s2/lib/libtinyusb.a index 2a3c9b9c..d66e4fcf 100644 Binary files a/tools/sdk/esp32s2/lib/libtinyusb.a and b/tools/sdk/esp32s2/lib/libtinyusb.a differ