summaryrefslogtreecommitdiff
path: root/src/device/usbd.c
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2026-02-27 11:47:58 +0100
committerHiFiPhile <[email protected]>2026-02-27 11:47:58 +0100
commitecc0e12dd5ab58cffafb03a8d1800dc68bed1c6f (patch)
tree6ced64f1cca39af4aaf77a3861785f5b21f71b1b /src/device/usbd.c
parenta3fd3071c17bdc7392db1361f3a97019351af337 (diff)
parentbd1e79bc6cefbbbe981691c3a55e24cf25537301 (diff)
Merge remote-tracking branch 'tinyusb/master' into dwc2_deinit
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/device/usbd.c')
-rw-r--r--src/device/usbd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 9cfc2cc59..127a7bd62 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;