From cb0337d77ef0b660b5a77b6eca64fbf22b4c059b Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser <kaspar@schleiser.de> Date: Wed, 9 Sep 2015 17:27:59 +0200 Subject: [PATCH] sys: xtimer: xtimer_set(): shoot directly if offset <= 1 --- sys/xtimer/xtimer_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/xtimer/xtimer_core.c b/sys/xtimer/xtimer_core.c index 0e1ceaf2e1..0e3a6a729f 100644 --- a/sys/xtimer/xtimer_core.c +++ b/sys/xtimer/xtimer_core.c @@ -121,8 +121,10 @@ void xtimer_set(xtimer_t *timer, uint32_t offset) uint32_t target = xtimer_now() + offset; if (offset < XTIMER_BACKOFF) { - /* spin until timer should be run */ - xtimer_spin_until(target); + if (offset > 1) { + /* spin until timer should be run */ + xtimer_spin_until(target); + } _shoot(timer); } -- GitLab