Skip to content

Commit 38057d6

Browse files
committed
Update tinyusb
1 parent 33f4745 commit 38057d6

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

tools/sdk/esp32s2/include/config/sdkconfig.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,16 +355,14 @@
355355
#define CONFIG_SPIFFS_USE_MTIME 1
356356
#define CONFIG_USB_ENABLED 1
357357
#define CONFIG_USB_MAX_POWER_USAGE 100
358-
#define CONFIG_USB_DYNAMIC_DRIVER_LOADING 1
359-
#define CONFIG_USB_DYNAMIC_DRIVER_MAX 16
360358
#define CONFIG_USB_CDC_ENABLED 1
361359
#define CONFIG_USB_CDC_RX_BUFSIZE 64
362360
#define CONFIG_USB_CDC_TX_BUFSIZE 64
363361
#define CONFIG_USB_DFU_RT_ENABLED 1
364362
#define CONFIG_USB_MSC_ENABLED 1
365363
#define CONFIG_USB_MSC_BUFSIZE 512
366364
#define CONFIG_USB_HID_ENABLED 1
367-
#define CONFIG_USB_HID_BUFSIZE 16
365+
#define CONFIG_USB_HID_BUFSIZE 64
368366
#define CONFIG_USB_MIDI_ENABLED 1
369367
#define CONFIG_USB_MIDI_RX_BUFSIZE 64
370368
#define CONFIG_USB_MIDI_TX_BUFSIZE 64

tools/sdk/esp32s2/include/tinyusb/tinyusb/src/osal/osal_freertos.h

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "semphr.h"
3333
#include "queue.h"
3434
#include "task.h"
35+
#include "tusb_option.h"
3536

3637
#ifdef __cplusplus
3738
extern "C" {
@@ -58,7 +59,19 @@ static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semde
5859

5960
static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
6061
{
61-
return in_isr ? xSemaphoreGiveFromISR(sem_hdl, NULL) : xSemaphoreGive(sem_hdl);
62+
if(!in_isr){
63+
return xSemaphoreGive(sem_hdl) != 0;
64+
}
65+
BaseType_t xHigherPriorityTaskWoken;
66+
BaseType_t res = xSemaphoreGiveFromISR(sem_hdl, &xHigherPriorityTaskWoken);
67+
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
68+
if (xHigherPriorityTaskWoken) {
69+
portYIELD_FROM_ISR();
70+
}
71+
#else
72+
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
73+
#endif
74+
return res != 0;
6275
}
6376

6477
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)
125138

126139
static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr)
127140
{
128-
return in_isr ? xQueueSendToBackFromISR(qhdl, data, NULL) : xQueueSendToBack(qhdl, data, OSAL_TIMEOUT_WAIT_FOREVER);
141+
if(!in_isr){
142+
return xQueueSendToBack(qhdl, data, OSAL_TIMEOUT_WAIT_FOREVER) != 0;
143+
}
144+
BaseType_t xHigherPriorityTaskWoken;
145+
BaseType_t res = xQueueSendToBackFromISR(qhdl, data, &xHigherPriorityTaskWoken);
146+
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
147+
if (xHigherPriorityTaskWoken) {
148+
portYIELD_FROM_ISR();
149+
}
150+
#else
151+
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
152+
#endif
153+
return res != 0;
129154
}
130155

131156
static inline bool osal_queue_empty(osal_queue_t qhdl)

tools/sdk/esp32s2/lib/libtinyusb.a

2.12 KB
Binary file not shown.

0 commit comments

Comments
 (0)