diff options
| author | Aleksei Musin <[email protected]> | 2026-02-09 12:22:20 +0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-09 12:22:20 +0400 |
| commit | 6e675da608b063e2ea7db1d700d788d6a247f9ec (patch) | |
| tree | 5bcf5bb529e6ca2ebefc889920b28f1fab851e3f /src/device/usbd.c | |
| parent | ebc9edfb7a512c8dd6816a40698c62c364bd78da (diff) | |
| parent | f5424c569ddc673a9c23b78febceed8f7f098509 (diff) | |
Merge branch 'hathach:master' into threadx_osal
Diffstat (limited to 'src/device/usbd.c')
| -rw-r--r-- | src/device/usbd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index 1e21c667a..cca4169d7 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -666,8 +666,14 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr) { return; } - // Loop until there is no more events in the queue - while (1) { + // Loop until there are no more events in the queue or CFG_TUD_TASK_EVENTS_PER_RUN is reached + for (unsigned epr = 0;; epr++) { +#if CFG_TUD_TASK_EVENTS_PER_RUN > 0 + if (epr >= CFG_TUD_TASK_EVENTS_PER_RUN) { + TU_LOG_USBD("USBD event limit (" TU_XSTRING(CFG_TUD_TASK_EVENTS_PER_RUN) ") reached\r\n"); + break; + } +#endif dcd_event_t event; if (!osal_queue_receive(_usbd_q, &event, timeout_ms)) { return; |
