From 03e9becfcffa5ed7b4abaca2bcac5f51446a2958 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 22 Feb 2019 10:06:59 +1100 Subject: [PATCH] AP_HAL_SITL: add missing override keywords --- libraries/AP_HAL_SITL/AnalogIn.h | 22 +++++++++++----------- libraries/AP_HAL_SITL/GPIO.h | 22 +++++++++++----------- libraries/AP_HAL_SITL/Semaphores.h | 6 +++--- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/libraries/AP_HAL_SITL/AnalogIn.h b/libraries/AP_HAL_SITL/AnalogIn.h index c05d8d90e6..d40c9e68fe 100644 --- a/libraries/AP_HAL_SITL/AnalogIn.h +++ b/libraries/AP_HAL_SITL/AnalogIn.h @@ -12,16 +12,16 @@ public: ADCSource(SITL_State *sitlState, int16_t pin); /* implement AnalogSource virtual api: */ - float read_average(); - float read_latest(); - void set_pin(uint8_t p); - float voltage_average(); - float voltage_latest(); - float voltage_average_ratiometric() { + float read_average() override; + float read_latest() override; + void set_pin(uint8_t p) override; + float voltage_average() override; + float voltage_latest() override; + float voltage_average_ratiometric() override { return voltage_average(); } - void set_stop_pin(uint8_t pin) {} - void set_settle_time(uint16_t settle_time_ms) {} + void set_stop_pin(uint8_t pin) override {} + void set_settle_time(uint16_t settle_time_ms) override {} private: SITL_State *_sitlState; @@ -33,9 +33,9 @@ private: class HALSITL::AnalogIn : public AP_HAL::AnalogIn { public: explicit AnalogIn(SITL_State *sitlState): _sitlState(sitlState) {} - void init(); - AP_HAL::AnalogSource* channel(int16_t n); - float board_voltage(void) { + void init() override; + AP_HAL::AnalogSource* channel(int16_t n) override; + float board_voltage(void) override { return 5.0f; } private: diff --git a/libraries/AP_HAL_SITL/GPIO.h b/libraries/AP_HAL_SITL/GPIO.h index 289835d4e1..4e94379091 100644 --- a/libraries/AP_HAL_SITL/GPIO.h +++ b/libraries/AP_HAL_SITL/GPIO.h @@ -5,17 +5,17 @@ class HALSITL::GPIO : public AP_HAL::GPIO { public: explicit GPIO(SITL_State *sitlState): _sitlState(sitlState) {} - void init(); - void pinMode(uint8_t pin, uint8_t output); - uint8_t read(uint8_t pin); - void write(uint8_t pin, uint8_t value); - void toggle(uint8_t pin); + void init() override; + void pinMode(uint8_t pin, uint8_t output) override; + uint8_t read(uint8_t pin) override; + void write(uint8_t pin, uint8_t value) override; + void toggle(uint8_t pin) override; /* Alternative interface: */ - AP_HAL::DigitalSource* channel(uint16_t n); + AP_HAL::DigitalSource* channel(uint16_t n) override; /* return true if USB cable is connected */ - bool usb_connected(void); + bool usb_connected(void) override; private: SITL_State *_sitlState; @@ -24,10 +24,10 @@ private: class HALSITL::DigitalSource : public AP_HAL::DigitalSource { public: explicit DigitalSource(uint8_t pin); - void mode(uint8_t output); - uint8_t read(); - void write(uint8_t value); - void toggle(); + void mode(uint8_t output) override; + uint8_t read() override; + void write(uint8_t value) override; + void toggle() override; private: uint8_t _pin; diff --git a/libraries/AP_HAL_SITL/Semaphores.h b/libraries/AP_HAL_SITL/Semaphores.h index 3ad8977d6e..0fdb4589c7 100644 --- a/libraries/AP_HAL_SITL/Semaphores.h +++ b/libraries/AP_HAL_SITL/Semaphores.h @@ -10,9 +10,9 @@ class HALSITL::Semaphore : public AP_HAL::Semaphore { public: Semaphore(); - bool give(); - bool take(uint32_t timeout_ms); - bool take_nonblocking(); + bool give() override; + bool take(uint32_t timeout_ms) override; + bool take_nonblocking() override; protected: pthread_mutex_t _lock; };