Skip to content
Snippets Groups Projects
Commit bd82feab authored by Joakim Nohlgård's avatar Joakim Nohlgård
Browse files

Merge pull request #4061 from kaspar030/xtimer/fix_setting_timer_in_past

sys: xtimer: add another safeguard against setting a timer in the past
parents c62113c3 c2f6417b
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