Skip to content

Commit dee87aa

Browse files
committed
Merge branch 'hotfix/ambigous-overloaded'
2 parents 995bc11 + 6fc8e6c commit dee87aa

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/BasicStepperDriver.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void BasicStepperDriver::setDirection(int direction){
8282
* Move the motor a given number of steps.
8383
* positive to move forward, negative to reverse
8484
*/
85-
int BasicStepperDriver::move(long steps){
85+
void BasicStepperDriver::move(long steps){
8686
if (steps >= 0){
8787
setDirection(1);
8888
} else {
@@ -106,18 +106,18 @@ int BasicStepperDriver::move(long steps){
106106
/*
107107
* Move the motor a given number of degrees (1-360)
108108
*/
109-
int BasicStepperDriver::rotate(long deg){
109+
void BasicStepperDriver::rotate(long deg){
110110
long steps = deg * motor_steps * (long)microsteps / 360;
111-
return move(steps);
111+
move(steps);
112112
}
113113
/*
114114
* Move the motor with sub-degree precision.
115115
* Note that using this function even once will add 1K to your program size
116116
* due to inclusion of float support.
117117
*/
118-
int BasicStepperDriver::rotate(double deg){
118+
void BasicStepperDriver::rotate(double deg){
119119
long steps = deg * motor_steps * microsteps / 360;
120-
return move(steps);
120+
move(steps);
121121
}
122122

123123
/*

src/BasicStepperDriver.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,18 @@ class BasicStepperDriver {
7979
* Move the motor a given number of steps.
8080
* positive to move forward, negative to reverse
8181
*/
82-
int move(long steps);
82+
void move(long steps);
8383
/*
8484
* Rotate the motor a given number of degrees (1-360)
8585
*/
86-
int rotate(long deg);
86+
void rotate(long deg);
87+
inline void rotate(int deg){
88+
rotate((long)deg);
89+
};
8790
/*
8891
* Rotate using a float or double for increased movement precision.
8992
*/
90-
int rotate(double deg);
93+
void rotate(double deg);
9194
/*
9295
* Set target motor RPM (1-200 is a reasonable range)
9396
*/

0 commit comments

Comments
 (0)