From fba962f7ff21198679b41f5a63110f83d6b70dea Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 12 Feb 2018 12:48:31 +1100 Subject: [PATCH] HAL_PX4: allow for different LED pins and fixed build --- libraries/AP_HAL_PX4/GPIO.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/libraries/AP_HAL_PX4/GPIO.h b/libraries/AP_HAL_PX4/GPIO.h index 249df28f49..82ebadec4c 100644 --- a/libraries/AP_HAL_PX4/GPIO.h +++ b/libraries/AP_HAL_PX4/GPIO.h @@ -16,12 +16,20 @@ */ #define PX4_GPIO_FMU_SERVO_PIN(n) (n+50) -#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 - # define HAL_GPIO_A_LED_PIN 27 - # define HAL_GPIO_B_LED_PIN 26 - # define HAL_GPIO_C_LED_PIN 25 - # define HAL_GPIO_LED_ON LOW - # define HAL_GPIO_LED_OFF HIGH +#ifndef HAL_GPIO_A_LED_PIN +#define HAL_GPIO_A_LED_PIN 27 +#endif +#ifndef HAL_GPIO_B_LED_PIN +#define HAL_GPIO_B_LED_PIN 26 +#endif +#ifndef HAL_GPIO_C_LED_PIN +#define HAL_GPIO_C_LED_PIN 25 +#endif +#ifndef HAL_GPIO_LED_ON +#define HAL_GPIO_LED_ON 0 +#endif +#ifndef HAL_GPIO_LED_OFF +#define HAL_GPIO_LED_OFF 1 #endif class PX4::PX4GPIO : public AP_HAL::GPIO {