Fix PPM in TIM1

This commit is contained in:
Petr Ledvina 2015-03-26 18:07:18 +01:00
parent 3e8ce5833f
commit a125228d1f
1 changed files with 18 additions and 0 deletions

View File

@ -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