Skip to content

Commit

Permalink
Fix issue laurb9#53.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruiyao committed Oct 1, 2018
1 parent c2bbf68 commit 6cba616
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 @@ -153,8 +153,8 @@ void BasicStepperDriver::alterMove(long steps){
switch (getCurrentState()){
case ACCELERATING: // this also works but will keep the original speed target
case CRUISING:
if (steps >= 0){
steps_remaining += steps;
if ((steps >= 0 && dir_state == HIGH) || (steps < 0 && dir_state == LOW)){
steps_remaining += abs(steps);
} else {
steps_remaining = max(steps_to_brake, steps_remaining+steps);
};
Expand Down

0 comments on commit 6cba616

Please sign in to comment.