AP_Notify: allow pca9685 to be compiled out of code

This commit is contained in:
Peter Barker 2022-11-08 12:22:04 +11:00 committed by Andrew Tridgell
parent 2ee0fb671b
commit d99e5b91d8
4 changed files with 14 additions and 0 deletions

View File

@ -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;

View File

@ -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

View File

@ -17,6 +17,8 @@
*/
#include "PCA9685LED_I2C.h"
#if AP_NOTIFY_PCA9685_ENABLED
#include <AP_HAL/AP_HAL.h>
#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

View File

@ -19,6 +19,8 @@
#include <AP_HAL/I2CDevice.h>
#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