Skip to content

Commit

Permalink
(bug) fix parameter order in STEP_PULSE macro (#86)
Browse files Browse the repository at this point in the history
This didn't affect calculations because all the parameters are divisors.
  • Loading branch information
laurb9 committed May 13, 2020
1 parent 5892985 commit 24244c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BasicStepperDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void BasicStepperDriver::startMove(long steps, long time){
default:
steps_to_cruise = 0;
steps_to_brake = 0;
step_pulse = cruise_step_pulse = STEP_PULSE(rpm, motor_steps, microsteps);
step_pulse = cruise_step_pulse = STEP_PULSE(motor_steps, microsteps, rpm);
if (time > steps_remaining * step_pulse){
step_pulse = (float)time / steps_remaining;
}
Expand Down Expand Up @@ -235,7 +235,7 @@ long BasicStepperDriver::getTimeForMove(long steps){
break;
case CONSTANT_SPEED:
default:
t = steps * STEP_PULSE(rpm, motor_steps, microsteps);
t = steps * STEP_PULSE(motor_steps, microsteps, rpm);
}
return round(t);
}
Expand Down

0 comments on commit 24244c9

Please sign in to comment.