mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #17409 from kaspar030/ztimer_no_timer_fix
sys/ztimer: don't access non-existant timer
This commit is contained in:
commit
43988120f9
@ -373,20 +373,23 @@ void ztimer_handler(ztimer_clock_t *clock)
|
||||
}
|
||||
#endif
|
||||
|
||||
clock->list.offset += clock->list.next->offset;
|
||||
clock->list.next->offset = 0;
|
||||
if (clock->list.next) {
|
||||
clock->list.offset += clock->list.next->offset;
|
||||
clock->list.next->offset = 0;
|
||||
|
||||
ztimer_t *entry = _now_next(clock);
|
||||
while (entry) {
|
||||
DEBUG("ztimer_handler(): trigger %p->%p at %" PRIu32 "\n",
|
||||
(void *)entry, (void *)entry->base.next, clock->ops->now(clock));
|
||||
entry->callback(entry->arg);
|
||||
entry = _now_next(clock);
|
||||
if (!entry) {
|
||||
/* See if any more alarms expired during callback processing */
|
||||
/* This reduces the number of implicit calls to clock->ops->now() */
|
||||
_ztimer_update_head_offset(clock);
|
||||
ztimer_t *entry = _now_next(clock);
|
||||
while (entry) {
|
||||
DEBUG("ztimer_handler(): trigger %p->%p at %" PRIu32 "\n",
|
||||
(void *)entry, (void *)entry->base.next, clock->ops->now(
|
||||
clock));
|
||||
entry->callback(entry->arg);
|
||||
entry = _now_next(clock);
|
||||
if (!entry) {
|
||||
/* See if any more alarms expired during callback processing */
|
||||
/* This reduces the number of implicit calls to clock->ops->now() */
|
||||
_ztimer_update_head_offset(clock);
|
||||
entry = _now_next(clock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user