1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 22:43:50 +01:00

Merge pull request #3939 from haukepetersen/fix_native_periph_timer

native/timer: fix return value for invalid channel
This commit is contained in:
Hauke Petersen 2015-09-23 22:54:05 +02:00
commit ff84390627

View File

@ -117,9 +117,12 @@ static void do_timer_set(unsigned int offset)
int timer_set(tim_t dev, int channel, unsigned int offset)
{
(void)dev;
(void)channel;
DEBUG("%s\n", __func__);
if (channel != 0) {
return -1;
}
if (!offset) {
offset = NATIVE_TIMER_MIN_RES;
}
@ -140,9 +143,7 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value)
target = NATIVE_TIMER_MIN_RES;
}
timer_set(dev, channel, target);
return 1;
return timer_set(dev, channel, target);
}
int timer_clear(tim_t dev, int channel)