From ceaeee5c5d64ee461a7954c96ed9f73c20b70dc6 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser <kaspar@schleiser.de> Date: Wed, 6 Jan 2016 13:39:49 +0100 Subject: [PATCH] Revert "native: periph/timer: prevent underflow in timer_set_absolute" This reverts commit ec441e9aa66ee1a10c8295d7f5659fe9acb5bfbe. --- cpu/native/periph/timer.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cpu/native/periph/timer.c b/cpu/native/periph/timer.c index 3ce06baa74..c31ae52243 100644 --- a/cpu/native/periph/timer.c +++ b/cpu/native/periph/timer.c @@ -135,15 +135,7 @@ int timer_set(tim_t dev, int channel, unsigned int offset) int timer_set_absolute(tim_t dev, int channel, unsigned int value) { uint32_t now = timer_read(dev); - int64_t target = (int32_t)(value - now); - - DEBUG("timer_set_absolute(): delta=%lli\n", target); - if (target < 0 && target > -NATIVE_TIMER_MIN_RES) { - DEBUG("timer_set_absolute(): preventing underflow.\n"); - target = NATIVE_TIMER_MIN_RES; - } - - return timer_set(dev, channel, target); + return timer_set(dev, channel, value - now); } int timer_clear(tim_t dev, int channel) -- GitLab