From 015098d2c26f932c510cb6de08242d213ac2f851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= <joakim.gebart@eistec.se> Date: Thu, 24 Sep 2015 06:44:47 +0200 Subject: [PATCH] kinetis: timer: return error if timer channel is not zero. --- cpu/kinetis_common/timer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cpu/kinetis_common/timer.c b/cpu/kinetis_common/timer.c index 83e1f195cf..0982615e17 100644 --- a/cpu/kinetis_common/timer.c +++ b/cpu/kinetis_common/timer.c @@ -144,7 +144,10 @@ int timer_set(tim_t dev, int channel, unsigned int timeout) int timer_set_absolute(tim_t dev, int channel, unsigned int value) { - (void) channel; /* we only support one channel */ + /* we only support one channel */ + if (channel != 0) { + return -1; + } switch (dev) { #if TIMER_0_EN @@ -180,7 +183,10 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value) int timer_clear(tim_t dev, int channel) { - (void) channel; /* we only support one channel */ + /* we only support one channel */ + if (channel != 0) { + return -1; + } switch (dev) { #if TIMER_0_EN -- GitLab