Skip to content
Snippets Groups Projects
Commit c2f6417b authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

sys: xtimer: add another safeguard against setting a timer in the past

parent a7bbc5ea
No related branches found
No related tags found
No related merge requests found
......@@ -482,6 +482,11 @@ overflow:
if (timer_list_head) {
/* schedule callback on next timer target time */
next_target = timer_list_head->target - XTIMER_OVERHEAD;
/* make sure we're not setting a time in the past */
if (next_target < (_xtimer_now() + XTIMER_ISR_BACKOFF)) {
goto overflow;
}
}
else {
/* there's no timer planned for this timer period */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment