mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
Fix PPM in TIM1
This commit is contained in:
parent
3e8ce5833f
commit
a125228d1f
1 changed files with 18 additions and 0 deletions
|
@ -383,6 +383,24 @@ void timerConfigure(const timerHardware_t *timerHardwarePtr, uint16_t period, ui
|
||||||
configTimeBase(timerHardwarePtr->tim, period, mhz);
|
configTimeBase(timerHardwarePtr->tim, period, mhz);
|
||||||
TIM_Cmd(timerHardwarePtr->tim, ENABLE);
|
TIM_Cmd(timerHardwarePtr->tim, ENABLE);
|
||||||
timerNVICConfigure(timerHardwarePtr->irq);
|
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
|
// allocate and configure timer channel. Timer priority is set to highest priority of its channels
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue