AP_Notify: rgbled methods protected and add override

no functional change
This commit is contained in:
Randy Mackay 2017-01-26 18:10:26 +09:00
parent 4aaeb4bfed
commit 0e20c8040c
7 changed files with 22 additions and 14 deletions

View File

@ -28,8 +28,11 @@ class DiscoLED: public RGBLed
{
public:
DiscoLED();
bool hw_init(void);
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b);
protected:
bool hw_init(void) override;
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
private:
Linux::PWM_Sysfs_Bebop red_pwm;
Linux::PWM_Sysfs_Bebop green_pwm;

View File

@ -24,8 +24,10 @@ class DiscreteRGBLed: public RGBLed {
public:
DiscreteRGBLed(uint16_t red, uint16_t green, uint16_t blue, bool polarity);
protected:
bool hw_init(void) override;
bool hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue) override;
private:
AP_HAL::DigitalSource *red_pin;
AP_HAL::DigitalSource *green_pin;

View File

@ -22,8 +22,8 @@
class NavioLED_I2C : public NavioLED
{
protected:
virtual bool hw_init(void);
virtual bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b);
bool hw_init(void) override;
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
private:
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;

View File

@ -9,8 +9,10 @@ public:
uint8_t led_medium, uint8_t led_dim);
RCOutputRGBLed(uint8_t red_channel, uint8_t green_channel,
uint8_t blue_channel);
bool hw_init();
virtual bool hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue);
protected:
bool hw_init() override;
virtual bool hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue) override;
private:
uint8_t _red_channel;

View File

@ -21,9 +21,9 @@
class ToshibaLED_I2C : public ToshibaLED
{
public:
bool hw_init(void);
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b);
protected:
bool hw_init(void) override;
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
private:
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;

View File

@ -24,9 +24,9 @@
class ToshibaLED_PX4 : public ToshibaLED
{
public:
bool hw_init(void);
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b);
protected:
bool hw_init(void) override;
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
private:
int _rgbled_fd;
void update_timer(void);

View File

@ -27,6 +27,7 @@ class VRBoard_LED: public RGBLed {
public:
VRBoard_LED();
bool hw_init(void);
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b);
protected:
bool hw_init(void) override;
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
};