mirror of https://github.com/ArduPilot/ardupilot
AP_Notify: init gpio state for LEDs
This commit is contained in:
parent
36aa666786
commit
927105cd25
|
@ -15,8 +15,7 @@
|
||||||
|
|
||||||
#include "PixRacerLED.h"
|
#include "PixRacerLED.h"
|
||||||
|
|
||||||
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 && CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_PX4_V4 \
|
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_PX4_V4 || CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
|
||||||
|| CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
|
|
||||||
|
|
||||||
#ifndef HAL_GPIO_A_LED_PIN
|
#ifndef HAL_GPIO_A_LED_PIN
|
||||||
#define HAL_GPIO_A_LED_PIN -1
|
#define HAL_GPIO_A_LED_PIN -1
|
||||||
|
@ -37,6 +36,9 @@ PixRacerLED::PixRacerLED() :
|
||||||
|
|
||||||
bool PixRacerLED::hw_init(void)
|
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_A_LED_PIN, HAL_GPIO_LED_OFF);
|
||||||
hal.gpio->write(HAL_GPIO_B_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);
|
hal.gpio->write(HAL_GPIO_C_LED_PIN, HAL_GPIO_LED_OFF);
|
||||||
|
|
Loading…
Reference in New Issue