Browse Source

BugFix:Prevent drv_led_pwm passing a value of 0 to px4_arch_configgpio

This prevents the meta value of 0 => not used from being passed to
  px4_arch_configgpio. As this would map to PORTA|PIN0 and is not
  the intended configuration.
sbg
David Sidrane 8 years ago committed by Lorenz Meier
parent
commit
d42f8f4745
  1. 6
      src/drivers/stm32/drv_led_pwm.cpp

6
src/drivers/stm32/drv_led_pwm.cpp

@ -167,10 +167,13 @@ static void led_pwm_timer_init_timer(unsigned timer) @@ -167,10 +167,13 @@ static void led_pwm_timer_init_timer(unsigned timer)
static void
led_pwm_channel_init(unsigned channel)
{
/* Only initialize used channels */
if (led_pwm_channels[channel].timer_channel) {
unsigned timer = led_pwm_channels[channel].timer_index;
/* configure the GPIO first */
px4_arch_configgpio(led_pwm_channels[channel].gpio_out);
/* configure the channel */
@ -195,6 +198,7 @@ led_pwm_channel_init(unsigned channel) @@ -195,6 +198,7 @@ led_pwm_channel_init(unsigned channel)
rCCER(timer) |= GTIM_CCER_CC4E;
break;
}
}
}
int

Loading…
Cancel
Save