Browse Source

AP_Notify: don't use pinMode for pixracer LEDs

this is needed for LEDs that are driven by 5V, which means they need
to use OPENDRAIN.
master
Andrew Tridgell 6 years ago
parent
commit
0e28f66761
  1. 4
      libraries/AP_Notify/PixRacerLED.cpp

4
libraries/AP_Notify/PixRacerLED.cpp

@ -36,9 +36,13 @@ PixRacerLED::PixRacerLED() : @@ -36,9 +36,13 @@ PixRacerLED::PixRacerLED() :
bool PixRacerLED::hw_init(void)
{
// when HAL_GPIO_LED_ON is 0 then we must not use pinMode()
// as it could remove the OPENDRAIN attribute on the pin
#if HAL_GPIO_LED_ON != 0
hal.gpio->pinMode(HAL_GPIO_A_LED_PIN, HAL_GPIO_OUTPUT);
hal.gpio->pinMode(HAL_GPIO_B_LED_PIN, HAL_GPIO_OUTPUT);
hal.gpio->pinMode(HAL_GPIO_C_LED_PIN, HAL_GPIO_OUTPUT);
#endif
hal.gpio->write(HAL_GPIO_A_LED_PIN, HAL_GPIO_LED_OFF);
hal.gpio->write(HAL_GPIO_B_LED_PIN, HAL_GPIO_LED_OFF);
hal.gpio->write(HAL_GPIO_C_LED_PIN, HAL_GPIO_LED_OFF);

Loading…
Cancel
Save