From 0e20c8040c217f45ab784338b88b0fa83459c421 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Thu, 26 Jan 2017 18:10:26 +0900 Subject: [PATCH] AP_Notify: rgbled methods protected and add override no functional change --- libraries/AP_Notify/DiscoLED.h | 7 +++++-- libraries/AP_Notify/DiscreteRGBLed.h | 2 ++ libraries/AP_Notify/NavioLED_I2C.h | 4 ++-- libraries/AP_Notify/RCOutputRGBLed.h | 6 ++++-- libraries/AP_Notify/ToshibaLED_I2C.h | 6 +++--- libraries/AP_Notify/ToshibaLED_PX4.h | 6 +++--- libraries/AP_Notify/VRBoard_LED.h | 5 +++-- 7 files changed, 22 insertions(+), 14 deletions(-) diff --git a/libraries/AP_Notify/DiscoLED.h b/libraries/AP_Notify/DiscoLED.h index 344a125adb..b3a9f2f1d5 100644 --- a/libraries/AP_Notify/DiscoLED.h +++ b/libraries/AP_Notify/DiscoLED.h @@ -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; diff --git a/libraries/AP_Notify/DiscreteRGBLed.h b/libraries/AP_Notify/DiscreteRGBLed.h index c890b3c59d..caf2d04b7b 100644 --- a/libraries/AP_Notify/DiscreteRGBLed.h +++ b/libraries/AP_Notify/DiscreteRGBLed.h @@ -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; diff --git a/libraries/AP_Notify/NavioLED_I2C.h b/libraries/AP_Notify/NavioLED_I2C.h index ca3f9662e6..be0f928e93 100644 --- a/libraries/AP_Notify/NavioLED_I2C.h +++ b/libraries/AP_Notify/NavioLED_I2C.h @@ -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 _dev; diff --git a/libraries/AP_Notify/RCOutputRGBLed.h b/libraries/AP_Notify/RCOutputRGBLed.h index b8b3bd535d..38eb0866ed 100644 --- a/libraries/AP_Notify/RCOutputRGBLed.h +++ b/libraries/AP_Notify/RCOutputRGBLed.h @@ -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; diff --git a/libraries/AP_Notify/ToshibaLED_I2C.h b/libraries/AP_Notify/ToshibaLED_I2C.h index ecfe3dd911..cd33723e6f 100644 --- a/libraries/AP_Notify/ToshibaLED_I2C.h +++ b/libraries/AP_Notify/ToshibaLED_I2C.h @@ -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 _dev; diff --git a/libraries/AP_Notify/ToshibaLED_PX4.h b/libraries/AP_Notify/ToshibaLED_PX4.h index d4caf263d0..3499aa7f00 100644 --- a/libraries/AP_Notify/ToshibaLED_PX4.h +++ b/libraries/AP_Notify/ToshibaLED_PX4.h @@ -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); diff --git a/libraries/AP_Notify/VRBoard_LED.h b/libraries/AP_Notify/VRBoard_LED.h index b45e94dc8b..77e38dcb1b 100644 --- a/libraries/AP_Notify/VRBoard_LED.h +++ b/libraries/AP_Notify/VRBoard_LED.h @@ -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; };