1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #17394 from fjmolinas/pr_evtimer_now_ztimer

sys/evtimer: use now returned by set
This commit is contained in:
Francisco 2021-12-15 12:11:44 +01:00 committed by GitHub
commit e2608e178f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,12 +95,9 @@ static void _set_timer(evtimer_t *evtimer)
evtimer_event_t *next_event = evtimer->events;
#if IS_USED(MODULE_EVTIMER_ON_ZTIMER)
evtimer->base = ztimer_now(ZTIMER_MSEC);
evtimer->base = ztimer_set(ZTIMER_MSEC, &evtimer->timer, next_event->offset);
DEBUG("evtimer: now=%" PRIu32 " ms setting ztimer to %" PRIu32 " ms\n",
evtimer->base, next_event->offset);
ztimer_set(ZTIMER_MSEC, &evtimer->timer, next_event->offset);
#else
uint64_t offset_us = (uint64_t)next_event->offset * US_PER_MS;