From 99dd85d51c19e432c55e4fc0098203ffc7131f90 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 22 Mar 2024 13:22:21 +1100 Subject: [PATCH] AP_HAL_ChibiOS: enforce HAL_GPIO_LED_OFF is not(HAL_GPIO_LED_ON) the current "flexibility" allows for ON/OFF to be the same value. Many hwdef files where only setting one of these, leaving the other at teh default, too.... --- libraries/AP_HAL_ChibiOS/GPIO.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/GPIO.h b/libraries/AP_HAL_ChibiOS/GPIO.h index d467f1f0fd..d149ef2801 100644 --- a/libraries/AP_HAL_ChibiOS/GPIO.h +++ b/libraries/AP_HAL_ChibiOS/GPIO.h @@ -22,10 +22,12 @@ #define HAL_GPIO_LED_ON 0 #endif -#ifndef HAL_GPIO_LED_OFF -#define HAL_GPIO_LED_OFF 1 +#ifdef HAL_GPIO_LED_OFF +#error "HAL_GPIO_LED_OFF must not be defined, it is implicitly !HAL_GPIO_LED_ON" #endif +#define HAL_GPIO_LED_OFF (!HAL_GPIO_LED_ON) + /* pin types for alternative configuration */