mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
LP-72 Fixes PPM input on receiver port. Added extra interrupt channel init for TIM1 & TIM8. Removed TIM8_UP_IRQHandler, as there is no such irq in stm32f4 line.
This commit is contained in:
parent
b6fbfba2af
commit
1d3d784f8b
@ -129,6 +129,23 @@ int32_t PIOS_TIM_InitClock(const struct pios_tim_clock_cfg *cfg)
|
||||
/* Enable Interrupts */
|
||||
NVIC_Init(&cfg->irq.init);
|
||||
|
||||
|
||||
// Advanced timers TIM1 & TIM8 need special handling:
|
||||
// There are up to 4 separate interrupts handlers for each advanced timer, but
|
||||
// pios_tim_clock_cfg has provision for only one irq init, so we take care here
|
||||
// to enable additional irq channels that we intend to use.
|
||||
|
||||
|
||||
if (cfg->timer == TIM1) {
|
||||
NVIC_InitTypeDef init = cfg->irq.init;
|
||||
init.NVIC_IRQChannel = TIM1_UP_TIM10_IRQn;
|
||||
NVIC_Init(&init);
|
||||
} else if (cfg->timer == TIM8) {
|
||||
NVIC_InitTypeDef init = cfg->irq.init;
|
||||
init.NVIC_IRQChannel = TIM8_UP_TIM13_IRQn;
|
||||
NVIC_Init(&init);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -376,12 +393,6 @@ static void PIOS_TIM_7_irq_handler(void)
|
||||
PIOS_TIM_generic_irq_handler(TIM7);
|
||||
}
|
||||
|
||||
void TIM8_UP_IRQHandler(void) __attribute__((alias("PIOS_TIM_8_UP_irq_handler")));
|
||||
static void PIOS_TIM_8_UP_irq_handler(void)
|
||||
{
|
||||
PIOS_TIM_generic_irq_handler(TIM8);
|
||||
}
|
||||
|
||||
void TIM8_CC_IRQHandler(void) __attribute__((alias("PIOS_TIM_8_CC_irq_handler")));
|
||||
static void PIOS_TIM_8_CC_irq_handler(void)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user