From b7341302a0db6aadc8bb118e9e2c2ba57723dd99 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Thu, 16 Oct 2014 21:09:43 +0000 Subject: [PATCH] assert that we wait at least as long as requested with embedded timer --- src/run_loop_embedded.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/run_loop_embedded.c b/src/run_loop_embedded.c index 3e4aeb55a..2e17d7270 100644 --- a/src/run_loop_embedded.c +++ b/src/run_loop_embedded.c @@ -92,7 +92,8 @@ static void embedded_set_timer(timer_source_t *ts, uint32_t timeout_in_ms){ #ifdef HAVE_TICK uint32_t ticks = embedded_ticks_for_ms(timeout_in_ms); if (ticks == 0) ticks++; - ts->timeout = system_ticks + ticks; + // time until next tick is < hal_tick_get_tick_period_in_ms() and we don't know, so we add one + ts->timeout = system_ticks + 1 + ticks; #endif }