summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-02-06 18:09:53 +0700
committerhathach <[email protected]>2026-02-06 18:09:53 +0700
commitcb19d620e8084765dddc2ddb93c00565934c5ac4 (patch)
tree89074a01e1030b381d3ccec1ec8ccc2e9053a044 /src/host
parent8ef8ee1946f3c0f600500eb49b2b0c1352f8dcb8 (diff)
parentbe5e23453565d9ccc578f08af52ab86ce4cef0be (diff)
Merge branch 'refs/heads/master' into musb_fix
Diffstat (limited to 'src/host')
-rw-r--r--src/host/usbh.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index a725b7c8b..41f41dcfb 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -599,8 +599,14 @@ void tuh_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_TUH_TASK_EVENTS_PER_RUN is reached
+ for (unsigned epr = 0;; epr++) {
+#if CFG_TUH_TASK_EVENTS_PER_RUN > 0
+ if (epr >= CFG_TUH_TASK_EVENTS_PER_RUN) {
+ TU_LOG_USBH("USBH event limit (" TU_XSTRING(CFG_TUH_TASK_EVENTS_PER_RUN) ") reached\r\n");
+ break;
+ }
+#endif
hcd_event_t event;
if (!osal_queue_receive(_usbh_q, &event, timeout_ms)) { return; }