Skip to content
Snippets Groups Projects
Commit 1664bcbf authored by Hauke Petersen's avatar Hauke Petersen
Browse files

native/timer: fix return value for invalid channel

parent 830bf360
No related branches found
No related tags found
No related merge requests found
...@@ -117,9 +117,12 @@ static void do_timer_set(unsigned int offset) ...@@ -117,9 +117,12 @@ static void do_timer_set(unsigned int offset)
int timer_set(tim_t dev, int channel, unsigned int offset) int timer_set(tim_t dev, int channel, unsigned int offset)
{ {
(void)dev; (void)dev;
(void)channel;
DEBUG("%s\n", __func__); DEBUG("%s\n", __func__);
if (channel != 0) {
return -1;
}
if (!offset) { if (!offset) {
offset = NATIVE_TIMER_MIN_RES; offset = NATIVE_TIMER_MIN_RES;
} }
...@@ -140,9 +143,7 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value) ...@@ -140,9 +143,7 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value)
target = NATIVE_TIMER_MIN_RES; target = NATIVE_TIMER_MIN_RES;
} }
timer_set(dev, channel, target); return timer_set(dev, channel, target);
return 1;
} }
int timer_clear(tim_t dev, int channel) int timer_clear(tim_t dev, int channel)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment