Revert "native: periph/timer: prevent underflow in timer_set_absolute"

This reverts commit ec441e9aa66ee1a10c8295d7f5659fe9acb5bfbe.
This commit is contained in:
Kaspar Schleiser 2016-01-06 13:39:49 +01:00
parent 6a28814cf9
commit ceaeee5c5d

View File

@ -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)