diff --git a/libraries/AP_Notify/AP_Notify_config.h b/libraries/AP_Notify/AP_Notify_config.h index e2a4ea6695..85fbf2ac3b 100644 --- a/libraries/AP_Notify/AP_Notify_config.h +++ b/libraries/AP_Notify/AP_Notify_config.h @@ -8,6 +8,10 @@ #endif #include +#ifndef HAL_DISPLAY_ENABLED +#define HAL_DISPLAY_ENABLED 1 +#endif + #ifndef AP_NOTIFY_LP5562_ENABLED #define AP_NOTIFY_LP5562_ENABLED 1 #endif diff --git a/libraries/AP_Notify/Display.cpp b/libraries/AP_Notify/Display.cpp index c1392743fe..42814e1ca5 100644 --- a/libraries/AP_Notify/Display.cpp +++ b/libraries/AP_Notify/Display.cpp @@ -14,6 +14,10 @@ */ /* Notify display driver for 128 x 64 pixel displays */ +#include "AP_Notify_config.h" + +#if HAL_DISPLAY_ENABLED + #include "Display.h" #include "Display_SH1106_I2C.h" @@ -587,3 +591,5 @@ void Display::update_text(uint8_t r) draw_text(COLUMN(0), ROW(0), msg); } + +#endif // HAL_DISPLAY_ENABLED diff --git a/libraries/AP_Notify/Display.h b/libraries/AP_Notify/Display.h index 4ab8f98aed..5c0fbb3e85 100644 --- a/libraries/AP_Notify/Display.h +++ b/libraries/AP_Notify/Display.h @@ -1,10 +1,10 @@ #pragma once -#include "NotifyDevice.h" +#include "AP_Notify_config.h" -#ifndef HAL_DISPLAY_ENABLED -#define HAL_DISPLAY_ENABLED !HAL_MINIMIZE_FEATURES -#endif +#if HAL_DISPLAY_ENABLED + +#include "NotifyDevice.h" #define ROW(Y) ((Y * 10) + 6) #define COLUMN(X) ((X * 7) + 0) @@ -43,3 +43,5 @@ private: // stop showing text in display after this many millis: const uint16_t _send_text_valid_millis = 20000; }; + +#endif // HAL_DISPLAY_ENABLED