From 6df32d6851ff3606c73131f607995cab261db67a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 6 Oct 2018 19:43:29 +1000 Subject: [PATCH] AP_Notify: init gpio state for LEDs --- libraries/AP_Notify/PixRacerLED.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Notify/PixRacerLED.cpp b/libraries/AP_Notify/PixRacerLED.cpp index dd9957dcda..957cc669b4 100644 --- a/libraries/AP_Notify/PixRacerLED.cpp +++ b/libraries/AP_Notify/PixRacerLED.cpp @@ -15,8 +15,7 @@ #include "PixRacerLED.h" -#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 && CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_PX4_V4 \ - || CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS +#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_PX4_V4 || CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS #ifndef HAL_GPIO_A_LED_PIN #define HAL_GPIO_A_LED_PIN -1 @@ -37,6 +36,9 @@ PixRacerLED::PixRacerLED() : bool PixRacerLED::hw_init(void) { + 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); 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);