From ebd021ceac839d41adfc774ed305c901bba5e591 Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Sun, 27 Jun 2021 12:55:59 -1000 Subject: [PATCH] Fixed some virtual / override problems In some cases, virtual and override were used simultaneously In other cases, destructors were virtual in non-base classes. --- Grbl_Esp32/src/Spindles/10vSpindle.h | 2 +- Grbl_Esp32/src/Spindles/BESCSpindle.h | 4 ++-- Grbl_Esp32/src/Spindles/DacSpindle.h | 2 +- Grbl_Esp32/src/Spindles/Laser.h | 2 +- Grbl_Esp32/src/Spindles/NullSpindle.h | 2 +- Grbl_Esp32/src/Spindles/OnOffSpindle.h | 6 +++--- Grbl_Esp32/src/Spindles/PWMSpindle.h | 10 +++++----- Grbl_Esp32/src/Spindles/RelaySpindle.h | 2 +- Grbl_Esp32/src/Spindles/Spindle.h | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Grbl_Esp32/src/Spindles/10vSpindle.h b/Grbl_Esp32/src/Spindles/10vSpindle.h index 601784b9..03bb98df 100644 --- a/Grbl_Esp32/src/Spindles/10vSpindle.h +++ b/Grbl_Esp32/src/Spindles/10vSpindle.h @@ -55,7 +55,7 @@ namespace Spindles { // Name of the configurable. Must match the name registered in the cpp file. const char* name() const override { return "10V"; } - virtual ~_10v() {} + ~_10v() {} protected: void set_enable(bool enable_pin); diff --git a/Grbl_Esp32/src/Spindles/BESCSpindle.h b/Grbl_Esp32/src/Spindles/BESCSpindle.h index 01d84468..b1eca71a 100644 --- a/Grbl_Esp32/src/Spindles/BESCSpindle.h +++ b/Grbl_Esp32/src/Spindles/BESCSpindle.h @@ -63,7 +63,7 @@ namespace Spindles { void init() override; void config_message() override; - virtual void set_output(uint32_t duty) override; + void set_output(uint32_t duty) override; // Configuration handlers: void validate() const override { PWM::validate(); } @@ -80,6 +80,6 @@ namespace Spindles { // Name of the configurable. Must match the name registered in the cpp file. const char* name() const override { return "BESC"; } - virtual ~BESC() {} + ~BESC() {} }; } diff --git a/Grbl_Esp32/src/Spindles/DacSpindle.h b/Grbl_Esp32/src/Spindles/DacSpindle.h index c59cf481..92d5c5b8 100644 --- a/Grbl_Esp32/src/Spindles/DacSpindle.h +++ b/Grbl_Esp32/src/Spindles/DacSpindle.h @@ -49,7 +49,7 @@ namespace Spindles { // Name of the configurable. Must match the name registered in the cpp file. const char* name() const override { return "DAC"; } - virtual ~Dac() {} + ~Dac() {} private: bool _gpio_ok; // DAC is on a valid pin diff --git a/Grbl_Esp32/src/Spindles/Laser.h b/Grbl_Esp32/src/Spindles/Laser.h index 6f28cf39..352cb90b 100644 --- a/Grbl_Esp32/src/Spindles/Laser.h +++ b/Grbl_Esp32/src/Spindles/Laser.h @@ -52,6 +52,6 @@ namespace Spindles { PWM::group(handler); } - virtual ~Laser() {} + ~Laser() {} }; } diff --git a/Grbl_Esp32/src/Spindles/NullSpindle.h b/Grbl_Esp32/src/Spindles/NullSpindle.h index 6515d49b..69a466ed 100644 --- a/Grbl_Esp32/src/Spindles/NullSpindle.h +++ b/Grbl_Esp32/src/Spindles/NullSpindle.h @@ -47,6 +47,6 @@ namespace Spindles { // Name of the configurable. Must match the name registered in the cpp file. const char* name() const override { return "NoSpindle"; } - virtual ~Null() {} + ~Null() {} }; } diff --git a/Grbl_Esp32/src/Spindles/OnOffSpindle.h b/Grbl_Esp32/src/Spindles/OnOffSpindle.h index 57ded712..64afefd9 100644 --- a/Grbl_Esp32/src/Spindles/OnOffSpindle.h +++ b/Grbl_Esp32/src/Spindles/OnOffSpindle.h @@ -36,9 +36,9 @@ namespace Spindles { void init() override; - virtual void setSpeedfromISR(uint32_t dev_speed) override; - void setState(SpindleState state, SpindleSpeed speed) override; - void config_message() override; + void setSpeedfromISR(uint32_t dev_speed) override; + void setState(SpindleState state, SpindleSpeed speed) override; + void config_message() override; // Methods introduced by this base clase virtual void set_direction(bool Clockwise); diff --git a/Grbl_Esp32/src/Spindles/PWMSpindle.h b/Grbl_Esp32/src/Spindles/PWMSpindle.h index b0120640..56d40976 100644 --- a/Grbl_Esp32/src/Spindles/PWMSpindle.h +++ b/Grbl_Esp32/src/Spindles/PWMSpindle.h @@ -40,10 +40,10 @@ namespace Spindles { PWM& operator=(const PWM&) = delete; PWM& operator=(PWM&&) = delete; - void init() override; - virtual void setSpeedfromISR(uint32_t dev_speed) override; - void setState(SpindleState state, SpindleSpeed speed) override; - void config_message() override; + void init() override; + void setSpeedfromISR(uint32_t dev_speed) override; + void setState(SpindleState state, SpindleSpeed speed) override; + void config_message() override; // Configuration handlers: void validate() const override { Spindle::validate(); } @@ -67,7 +67,7 @@ namespace Spindles { // Configurable uint32_t _pwm_freq = 5000; - virtual void set_output(uint32_t duty) override; + void set_output(uint32_t duty) override; virtual void deinit(); virtual void get_pins_and_settings(); diff --git a/Grbl_Esp32/src/Spindles/RelaySpindle.h b/Grbl_Esp32/src/Spindles/RelaySpindle.h index 4598fa4f..1521a25c 100644 --- a/Grbl_Esp32/src/Spindles/RelaySpindle.h +++ b/Grbl_Esp32/src/Spindles/RelaySpindle.h @@ -34,7 +34,7 @@ namespace Spindles { Relay& operator=(const Relay&) = delete; Relay& operator=(Relay&&) = delete; - virtual ~Relay() {} + ~Relay() {} // Configuration handlers: diff --git a/Grbl_Esp32/src/Spindles/Spindle.h b/Grbl_Esp32/src/Spindles/Spindle.h index d66e7266..22172509 100644 --- a/Grbl_Esp32/src/Spindles/Spindle.h +++ b/Grbl_Esp32/src/Spindles/Spindle.h @@ -98,7 +98,7 @@ namespace Spindles { // TODO: Validate spinup/spindown delay? } - virtual void afterParse() override; + void afterParse() override; void group(Configuration::HandlerBase& handler) override { handler.item("spinup_ms", _spinup_ms);