We must wait at least the requested amount

This commit is contained in:
Cédric Berger
2026-03-22 14:02:50 +01:00
parent 8a9f44bdd2
commit f615202b9b

View File

@ -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;
}