Skip to content

Commit

Permalink
Merge pull request #343 from gtoonstra/ppm-negative-fix
Browse files Browse the repository at this point in the history
[stm32] actually honor PPM_PULSE_TYPE_NEGATIVE and trigger on falling flank
  • Loading branch information
flixr committed Jan 12, 2013
2 parents ddfde40 + 8f5b39f commit 6bc5fb1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sw/airborne/arch/stm32/subsystems/radio_control/ppm_arch.c
Expand Up @@ -104,7 +104,13 @@ void ppm_arch_init ( void ) {
The external signal is connected to TIM2 CH2 pin (PA.01)
The Rising edge is used as active edge,
------------------------------------------------------------ */
#if defined PPM_PULSE_TYPE && PPM_PULSE_TYPE == PPM_PULSE_TYPE_POSITIVE
timer_ic_set_polarity(PPM_TIMER, PPM_CHANNEL, TIM_IC_RISING);
#elif defined PPM_PULSE_TYPE && PPM_PULSE_TYPE == PPM_PULSE_TYPE_NEGATIVE
timer_ic_set_polarity(PPM_TIMER, PPM_CHANNEL, TIM_IC_FALLING);
#else
#error "ppm_arch.c: Unknown PM_PULSE_TYPE"
#endif
timer_ic_set_input(PPM_TIMER, PPM_CHANNEL, PPM_TIMER_INPUT);
timer_ic_set_prescaler(PPM_TIMER, PPM_CHANNEL, TIM_IC_PSC_OFF);
timer_ic_set_filter(PPM_TIMER, PPM_CHANNEL, TIM_IC_OFF);
Expand Down

0 comments on commit 6bc5fb1

Please sign in to comment.