Skip to content

Commit 12b4ac1

Browse files
committed
Call vTaskDelay directly in usb_background
This minimizes the delay added. (`port_yield()` does vTaskDelay(4) so low priority tasks run.)
1 parent 5a769dd commit 12b4ac1

File tree

1 file changed

+4
-3
lines changed
  • supervisor/shared/usb

1 file changed

+4
-3
lines changed

supervisor/shared/usb/usb.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ void usb_background(void) {
171171
#if CIRCUITPY_USB_HOST
172172
tuh_task();
173173
#endif
174-
#else
175-
// Yield to the RTOS in case TinyUSB runs in a separate task.
176-
port_yield();
174+
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
175+
// Yield to FreeRTOS in case TinyUSB runs in a separate task. Don't use
176+
// port_yield() because it has a longer delay.
177+
vTaskDelay(0);
177178
#endif
178179
// No need to flush if there's no REPL.
179180
#if CIRCUITPY_USB_CDC

0 commit comments

Comments
 (0)