Merge pull request #15003 from kaspar030/ztimer_now64_tick

ztimer/core: ensure half-period tick when ztimer_now64 is used
This commit is contained in:
Kaspar Schleiser 2020-09-23 14:14:52 +02:00 committed by GitHub
commit e719eaf97c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,11 +295,17 @@ static void _ztimer_update(ztimer_clock_t *clock)
if (clock->list.next) {
clock->ops->set(clock, clock->list.next->offset);
}
else {
if (IS_USED(MODULE_ZTIMER_NOW64)) {
/* ensure there's at least one ISR per half period */
clock->ops->set(clock, clock->max_value >> 1);
}
else {
clock->ops->cancel(clock);
}
}
}
}
void ztimer_handler(ztimer_clock_t *clock)
{