From 9b8fe52d5da016c1e4315e1168f54ea1a59dec56 Mon Sep 17 00:00:00 2001 From: malo Date: Fri, 26 Feb 2016 12:32:45 +0100 Subject: [PATCH] xtimer: Fixed _add_timer_to_long_list since timer could be added at the wrong position. Signed-off-by: malo --- sys/xtimer/xtimer_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/xtimer/xtimer_core.c b/sys/xtimer/xtimer_core.c index 78a857844..06238f095 100644 --- a/sys/xtimer/xtimer_core.c +++ b/sys/xtimer/xtimer_core.c @@ -217,8 +217,8 @@ static void _add_timer_to_list(xtimer_t **list_head, xtimer_t *timer) static void _add_timer_to_long_list(xtimer_t **list_head, xtimer_t *timer) { while (*list_head - && (*list_head)->long_target <= timer->long_target - && (*list_head)->target <= timer->target) { + && (((*list_head)->long_target < timer->long_target) + || (((*list_head)->long_target == timer->long_target) && ((*list_head)->target <= timer->target)))) { list_head = &((*list_head)->next); }