summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Berger <[email protected]>2026-03-22 14:02:50 +0100
committerCédric Berger <[email protected]>2026-03-22 14:02:50 +0100
commitf615202b9b60a8a0151f6c9de049f024a68766d2 (patch)
treef0e74c71e1782a3ed5958c7b6497af823f3d0c18
parent8a9f44bdd267d05640d1028c07269d044291243b (diff)
We must wait at least the requested amount
-rw-r--r--src/host/usbh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index 75df6bf60..cc6ff9e6e 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -374,7 +374,8 @@ bool usbh_defer_func_ms_async(uint32_t ms, tusb_defer_func_t func, uintptr_t par
TU_LOG_USBH("USBH schedule function after %u ms\r\n", (unsigned int)ms);
_usbh_data.call_after.func = func;
_usbh_data.call_after.arg = param;
- _usbh_data.call_after.at_ms = tusb_time_millis_api() + ms;
+ // add one to ensure we wait at least 'ms' milliseconds
+ _usbh_data.call_after.at_ms = tusb_time_millis_api() + ms + 1;
return true;
}