subsys/usb: move to timepoint API

Remove sys_clock_timeout_end_calc() usage.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
Nicolas Pitre 2023-07-08 00:03:14 -04:00 committed by Carles Cufí
commit d1a50e540b

View file

@ -943,12 +943,12 @@ static bool is_dfu_started(void)
*/
void wait_for_usb_dfu(k_timeout_t delay)
{
uint64_t end = sys_clock_timeout_end_calc(delay);
k_timepoint_t end = sys_timepoint_calc(delay);
/* Wait for a prescribed duration of time. If DFU hasn't started within
* that time, stop waiting and proceed further.
*/
while (end > k_uptime_ticks()) {
while (!sys_timepoint_expired(end)) {
if (is_dfu_started()) {
k_poll_event_init(&dfu_event, K_POLL_TYPE_SIGNAL,
K_POLL_MODE_NOTIFY_ONLY, &dfu_signal);