mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-06-05 21:04:49 +00:00
mesh: glue: Fix calculating remaining time of delayed work
os_cputime_get32() returns value from totally different range, than os_time_get() and os_callout_reset() uses os_time_get(), so it should be also used here. os_cputime_ticks_to_usecs() doesn't work well with os_time_get(), so OS_TICKS_PER_SEC macro is used. X-Original-Commit: 1eb0d588b403935a8451ff8d87a9b5c993282e3c
This commit is contained in:
@@ -370,12 +370,12 @@ k_delayed_work_remaining_get (struct k_delayed_work *w)
|
||||
|
||||
OS_ENTER_CRITICAL(sr);
|
||||
|
||||
t = os_callout_remaining_ticks(&w->work, os_cputime_get32());
|
||||
t = os_callout_remaining_ticks(&w->work, os_time_get());
|
||||
|
||||
OS_EXIT_CRITICAL(sr);
|
||||
|
||||
/* We should return ms */
|
||||
return os_cputime_ticks_to_usecs(t) / 1000;
|
||||
return t / OS_TICKS_PER_SEC * 1000;
|
||||
}
|
||||
|
||||
int64_t k_uptime_get(void)
|
||||
|
||||
Reference in New Issue
Block a user