From db7722dee8410f27f6ea7dfcbfaf44e2f88cccf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Berger?= Date: Sun, 22 Mar 2026 14:12:50 +0100 Subject: [PATCH] Simplify tud_task() like in tuh_task() --- src/device/usbd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/device/usbd.c b/src/device/usbd.c index 42903576c..3c14175f6 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -803,10 +803,8 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr) { break; } -#if CFG_TUSB_OS != OPT_OS_NONE && CFG_TUSB_OS != OPT_OS_PICO - // return if there is no more events, for application to run other background - if (osal_queue_empty(_usbd_q)) { return; } -#endif + // allow to exit tud_task() if there is no event in the next run + timeout_ms = 0; } }