AP_Notify: tidy defines

This commit is contained in:
Peter Barker 2023-06-07 13:38:30 +10:00 committed by Andrew Tridgell
parent 65fd8a7120
commit 9eea693679
3 changed files with 37 additions and 11 deletions

View File

@ -74,6 +74,11 @@ AP_Notify *AP_Notify::_singleton;
// all I2C_LEDS
#define I2C_LEDS (ALL_TOSHIBALED_I2C | ALL_NCP5623_I2C | ALL_LP5562_I2C)
#if AP_NOTIFY_DRONECAN_LED_ENABLED
#define DRONECAN_LEDS Notify_LED_DroneCAN
#else
#define DRONECAN_LEDS 0
#endif
#ifndef DEFAULT_NTF_LED_TYPES
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
@ -90,7 +95,7 @@ AP_Notify *AP_Notify::_singleton;
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_EDGE
#define DEFAULT_NTF_LED_TYPES (Notify_LED_Board | I2C_LEDS |\
Notify_LED_DroneCAN)
DRONECAN_LEDS)
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI || \
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BLUE || \
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_POCKET || \
@ -346,30 +351,28 @@ void AP_Notify::add_backends(void)
ADD_BACKEND(new ProfiLED_SPI());
break;
#endif
case Notify_LED_OreoLED:
#if AP_NOTIFY_OREOLED_ENABLED
case Notify_LED_OreoLED:
if (_oreo_theme) {
ADD_BACKEND(new OreoLED_I2C(0, _oreo_theme));
}
#endif
break;
#endif
#if AP_NOTIFY_DRONECAN_LED_ENABLED
case Notify_LED_DroneCAN:
#if HAL_ENABLE_DRONECAN_DRIVERS
ADD_BACKEND(new DroneCAN_RGB_LED());
#endif // HAL_ENABLE_DRONECAN_DRIVERS
break;
#endif // AP_NOTIFY_DRONECAN_LED_ENABLED
#if AP_NOTIFY_SCRIPTING_LED_ENABLED
case Notify_LED_Scripting:
#if AP_SCRIPTING_ENABLED
ADD_BACKEND(new ScriptingLED());
#endif
break;
#endif
#if AP_NOTIFY_DSHOT_LED_ENABLED
case Notify_LED_DShot:
#if HAL_SUPPORT_RCOUT_SERIAL
ADD_BACKEND(new DShotLED());
#endif
break;
#endif
#if AP_NOTIFY_LP5562_ENABLED
case Notify_LED_LP5562_I2C_External:
FOREACH_I2C_EXTERNAL(b) {

View File

@ -68,8 +68,12 @@ public:
#if AP_NOTIFY_PCA9685_ENABLED
Notify_LED_PCA9685LED_I2C_External = (1 << 3), // External PCA9685_I2C
#endif
#if AP_NOTIFY_OREOLED_ENABLED
Notify_LED_OreoLED = (1 << 4), // Oreo
#endif
#if AP_NOTIFY_DRONECAN_LED_ENABLED
Notify_LED_DroneCAN = (1 << 5), // UAVCAN RGB LED
#endif
#if AP_NOTIFY_NCP5623_ENABLED
Notify_LED_NCP5623_I2C_External = (1 << 6), // External NCP5623
Notify_LED_NCP5623_I2C_Internal = (1 << 7), // Internal NCP5623
@ -80,9 +84,15 @@ public:
#if AP_NOTIFY_PROFILED_ENABLED
Notify_LED_ProfiLED = (1 << 9), // ProfiLED
#endif
#if AP_NOTIFY_SCRIPTING_LED_ENABLED
Notify_LED_Scripting = (1 << 10),// Colour accessor for scripting
#endif
#if AP_NOTIFY_DSHOT_LED_ENABLED
Notify_LED_DShot = (1 << 11),// Use dshot commands to set ESC LEDs
#endif
#if AP_NOTIFY_PROFILED_ENABLED
Notify_LED_ProfiLED_SPI = (1 << 12), // ProfiLED
#endif
#if AP_NOTIFY_LP5562_ENABLED
Notify_LED_LP5562_I2C_External = (1 << 13), // LP5562
Notify_LED_LP5562_I2C_Internal = (1 << 14), // LP5562

View File

@ -7,11 +7,20 @@
#include <GCS_MAVLink/GCS_MAVLink.h>
#endif
#include <AP_SerialLED/AP_SerialLED_config.h>
#include <AP_Scripting/AP_Scripting_config.h>
#ifndef HAL_DISPLAY_ENABLED
#define HAL_DISPLAY_ENABLED 1
#endif
#ifndef AP_NOTIFY_DRONECAN_LED_ENABLED
#define AP_NOTIFY_DRONECAN_LED_ENABLED HAL_ENABLE_DRONECAN_DRIVERS
#endif
#ifndef AP_NOTIFY_DSHOT_LED_ENABLED
#define AP_NOTIFY_DSHOT_LED_ENABLED HAL_SUPPORT_RCOUT_SERIAL
#endif
#ifndef AP_NOTIFY_LP5562_ENABLED
#define AP_NOTIFY_LP5562_ENABLED 1
#endif
@ -36,6 +45,10 @@
#define AP_NOTIFY_PROFILED_SPI_ENABLED 0 // requires hwdef to have SPI line
#endif
#ifndef AP_NOTIFY_SCRIPTING_LED_ENABLED
#define AP_NOTIFY_SCRIPTING_LED_ENABLED AP_SCRIPTING_ENABLED
#endif
#ifndef AP_NOTIFY_SERIALLED_ENABLED
#define AP_NOTIFY_SERIALLED_ENABLED AP_SERIALLED_ENABLED
#endif