Skip to content

Commit ffbbca0

Browse files
committed
Make Init, Enable, Disable and setPWM of drivers virtual
1 parent 0b7e25b commit ffbbca0

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/drivers/BLDCDriver3PWM.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ class BLDCDriver3PWM: public BLDCDriver
2525
BLDCDriver3PWM(int phA,int phB,int phC, int en1 = NOT_SET, int en2 = NOT_SET, int en3 = NOT_SET);
2626

2727
/** Motor hardware init function */
28-
int init() override;
28+
virtual int init() override;
2929
/** Motor disable function */
30-
void disable() override;
30+
virtual void disable() override;
3131
/** Motor enable function */
32-
void enable() override;
32+
virtual void enable() override;
3333

3434
// hardware variables
3535
int pwmA; //!< phase A pwm pin number
@@ -46,7 +46,7 @@ class BLDCDriver3PWM: public BLDCDriver
4646
* @param Ub - phase B voltage
4747
* @param Uc - phase C voltage
4848
*/
49-
void setPwm(float Ua, float Ub, float Uc) override;
49+
virtual void setPwm(float Ua, float Ub, float Uc) override;
5050

5151
/**
5252
* Set phase voltages to the hardware

src/drivers/BLDCDriver6PWM.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class BLDCDriver6PWM: public BLDCDriver
2626
BLDCDriver6PWM(int phA_h,int phA_l,int phB_h,int phB_l,int phC_h,int phC_l, int en = NOT_SET);
2727

2828
/** Motor hardware init function */
29-
int init() override;
29+
virtual int init() override;
3030
/** Motor disable function */
31-
void disable() override;
31+
virtual void disable() override;
3232
/** Motor enable function */
33-
void enable() override;
33+
virtual void enable() override;
3434

3535
// hardware variables
3636
int pwmA_h,pwmA_l; //!< phase A pwm pin number
@@ -50,7 +50,7 @@ class BLDCDriver6PWM: public BLDCDriver
5050
* @param Ub - phase B voltage
5151
* @param Uc - phase C voltage
5252
*/
53-
void setPwm(float Ua, float Ub, float Uc) override;
53+
virtual void setPwm(float Ua, float Ub, float Uc) override;
5454

5555
/**
5656
* Set phase voltages to the harware

src/drivers/StepperDriver2PWM.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class StepperDriver2PWM: public StepperDriver
3636
StepperDriver2PWM(int pwm1, int dir1, int pwm2, int dir2, int en1 = NOT_SET, int en2 = NOT_SET);
3737

3838
/** Motor hardware init function */
39-
int init() override;
39+
virtual int init() override;
4040
/** Motor disable function */
41-
void disable() override;
41+
virtual void disable() override;
4242
/** Motor enable function */
43-
void enable() override;
43+
virtual void enable() override;
4444

4545
// hardware variables
4646
int pwm1; //!< phase 1 pwm pin number
@@ -58,7 +58,7 @@ class StepperDriver2PWM: public StepperDriver
5858
* @param Ua phase A voltage
5959
* @param Ub phase B voltage
6060
*/
61-
void setPwm(float Ua, float Ub) override;
61+
virtual void setPwm(float Ua, float Ub) override;
6262

6363
/**
6464
* Set phase voltages to the hardware

src/drivers/StepperDriver4PWM.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ class StepperDriver4PWM: public StepperDriver
2525
StepperDriver4PWM(int ph1A,int ph1B,int ph2A,int ph2B, int en1 = NOT_SET, int en2 = NOT_SET);
2626

2727
/** Motor hardware init function */
28-
int init() override;
28+
virtual int init() override;
2929
/** Motor disable function */
30-
void disable() override;
30+
virtual void disable() override;
3131
/** Motor enable function */
32-
void enable() override;
32+
virtual void enable() override;
3333

3434
// hardware variables
3535
int pwm1A; //!< phase 1A pwm pin number
@@ -45,7 +45,7 @@ class StepperDriver4PWM: public StepperDriver
4545
* @param Ua phase A voltage
4646
* @param Ub phase B voltage
4747
*/
48-
void setPwm(float Ua, float Ub) override;
48+
virtual void setPwm(float Ua, float Ub) override;
4949

5050

5151
/**

0 commit comments

Comments
 (0)