From 75376b77938a4dd9dd74f035a63875ac56d17979 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 3 Mar 2017 13:54:12 -1000 Subject: [PATCH] Bugfix:Allow mode switch on a free timer --- src/drivers/stm32/drv_io_timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/drivers/stm32/drv_io_timer.c b/src/drivers/stm32/drv_io_timer.c index 9ac9f46937..dd1df52750 100644 --- a/src/drivers/stm32/drv_io_timer.c +++ b/src/drivers/stm32/drv_io_timer.c @@ -577,7 +577,9 @@ int io_timer_set_rate(unsigned timer, unsigned rate) /* Check that all channels are either in PWM or Oneshot */ - if ((channels & (channel_allocations[IOTimerChanMode_PWMOut] | channel_allocations[IOTimerChanMode_OneShot])) == + if ((channels & (channel_allocations[IOTimerChanMode_PWMOut] | + channel_allocations[IOTimerChanMode_OneShot] | + channel_allocations[IOTimerChanMode_NotUsed])) == channels) { /* Change only a timer that is owned by pwm or one shot */