From a125228d1fd1944bff85f15dfea205c70c256493 Mon Sep 17 00:00:00 2001 From: Petr Ledvina Date: Thu, 26 Mar 2015 18:07:18 +0100 Subject: [PATCH] Fix PPM in TIM1 --- src/main/drivers/timer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/drivers/timer.c b/src/main/drivers/timer.c index f17c54f21..7ad90c065 100644 --- a/src/main/drivers/timer.c +++ b/src/main/drivers/timer.c @@ -383,6 +383,24 @@ void timerConfigure(const timerHardware_t *timerHardwarePtr, uint16_t period, ui configTimeBase(timerHardwarePtr->tim, period, mhz); TIM_Cmd(timerHardwarePtr->tim, ENABLE); timerNVICConfigure(timerHardwarePtr->irq); + // HACK - enable second IRQ on timers that need it + switch(timerHardwarePtr->irq) { +#if defined(STM32F10X) + case TIM1_CC_IRQn: + timerNVICConfigure(TIM1_UP_IRQn); + break; +#endif +#ifdef STM32F303xC + case TIM1_CC_IRQn: + timerNVICConfigure(TIM1_UP_TIM16_IRQn); + break; +#endif +#if defined(STM32F10X_XL) + case TIM8_CC_IRQn: + timerNVICConfigure(TIM8_UP_IRQn); + break; +#endif + } } // allocate and configure timer channel. Timer priority is set to highest priority of its channels -- 2.11.4.GIT