mirror of https://github.com/ArduPilot/ardupilot
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.
This commit is contained in:
parent
26a6cccf21
commit
0e28f66761
|
@ -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…
Reference in New Issue