diff --git a/libraries/AP_Notify/AP_Notify.cpp b/libraries/AP_Notify/AP_Notify.cpp index 41d5ce7949..04d6ec6d81 100644 --- a/libraries/AP_Notify/AP_Notify.cpp +++ b/libraries/AP_Notify/AP_Notify.cpp @@ -307,9 +307,11 @@ void AP_Notify::add_backends(void) } break; #endif +#if AP_NOTIFY_PCA9685_ENABLED case Notify_LED_PCA9685LED_I2C_External: ADD_BACKEND(new PCA9685LED_I2C()); break; +#endif case Notify_LED_NeoPixel: ADD_BACKEND(new NeoPixel()); break; diff --git a/libraries/AP_Notify/AP_Notify_config.h b/libraries/AP_Notify/AP_Notify_config.h index da045ab52b..784d9cff7b 100644 --- a/libraries/AP_Notify/AP_Notify_config.h +++ b/libraries/AP_Notify/AP_Notify_config.h @@ -16,3 +16,7 @@ #ifndef AP_NOTIFY_NCP5623_ENABLED #define AP_NOTIFY_NCP5623_ENABLED 1 #endif + +#ifndef AP_NOTIFY_PCA9685_ENABLED +#define AP_NOTIFY_PCA9685_ENABLED 1 +#endif diff --git a/libraries/AP_Notify/PCA9685LED_I2C.cpp b/libraries/AP_Notify/PCA9685LED_I2C.cpp index 402cb946c0..ecebccf663 100644 --- a/libraries/AP_Notify/PCA9685LED_I2C.cpp +++ b/libraries/AP_Notify/PCA9685LED_I2C.cpp @@ -17,6 +17,8 @@ */ #include "PCA9685LED_I2C.h" +#if AP_NOTIFY_PCA9685_ENABLED + #include #define NAVIO_LED_BRIGHT 0x0 // full brightness @@ -110,3 +112,5 @@ void PCA9685LED_I2C::_timer(void) _dev->transfer(transaction, sizeof(transaction), nullptr, 0); } + +#endif // AP_NOTIFY_PCA9685_ENABLED diff --git a/libraries/AP_Notify/PCA9685LED_I2C.h b/libraries/AP_Notify/PCA9685LED_I2C.h index afb5bcab50..06961318b1 100644 --- a/libraries/AP_Notify/PCA9685LED_I2C.h +++ b/libraries/AP_Notify/PCA9685LED_I2C.h @@ -19,6 +19,8 @@ #include #include "RGBLed.h" +#if AP_NOTIFY_PCA9685_ENABLED + class PCA9685LED_I2C : public RGBLed { public: @@ -35,3 +37,5 @@ private: } rgb; bool _need_update; }; + +#endif // AP_NOTIFY_PCA9685_ENABLED