diff --git a/libraries/AP_Notify/AP_Notify.cpp b/libraries/AP_Notify/AP_Notify.cpp index 49a455b5f7..c11ba7ebc5 100644 --- a/libraries/AP_Notify/AP_Notify.cpp +++ b/libraries/AP_Notify/AP_Notify.cpp @@ -24,8 +24,12 @@ struct AP_Notify::notify_events_type AP_Notify::events; AP_BoardLED boardled; ToshibaLED_PX4 toshibaled; ToneAlarm_PX4 tonealarm; +#if OREOLED_ENABLED OreoLED_PX4 oreoled; NotifyDevice *AP_Notify::_devices[CONFIG_NOTIFY_DEVICES_COUNT] = {&boardled, &toshibaled, &tonealarm, &oreoled}; +#else + NotifyDevice *AP_Notify::_devices[CONFIG_NOTIFY_DEVICES_COUNT] = {&boardled, &toshibaled, &tonealarm}; +#endif #elif CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2 AP_BoardLED boardled; ExternalLED externalled; diff --git a/libraries/AP_Notify/AP_Notify.h b/libraries/AP_Notify/AP_Notify.h index e3867658f2..b5eb00d5d7 100644 --- a/libraries/AP_Notify/AP_Notify.h +++ b/libraries/AP_Notify/AP_Notify.h @@ -32,8 +32,12 @@ #include #include +#ifndef OREOLED_ENABLED + # define OREOLED_ENABLED 0 // set to 1 to enable OreoLEDs +#endif + #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 - #define CONFIG_NOTIFY_DEVICES_COUNT 4 + #define CONFIG_NOTIFY_DEVICES_COUNT (3+OREOLED_ENABLED) #elif CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2 #define CONFIG_NOTIFY_DEVICES_COUNT 3 #elif CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN