Babystepping code tweak

This commit is contained in:
Scott Lahteine 2017-09-26 23:36:58 -05:00
parent 7a29f802d0
commit 37eb6d1732

View File

@ -2064,13 +2064,10 @@ void Temperature::isr() {
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
LOOP_XYZ(axis) { LOOP_XYZ(axis) {
const int curTodo = babystepsTodo[axis]; // get rid of volatile for performance const int curTodo = babystepsTodo[axis]; // get rid of volatile for performance
if (curTodo > 0) { if (curTodo) {
stepper.babystep((AxisEnum)axis, /*fwd*/true); stepper.babystep((AxisEnum)axis, curTodo > 0);
babystepsTodo[axis]--; if (curTodo > 0) babystepsTodo[axis]--;
} else babystepsTodo[axis]++;
else if (curTodo < 0) {
stepper.babystep((AxisEnum)axis, /*fwd*/false);
babystepsTodo[axis]++;
} }
} }
#endif // BABYSTEPPING #endif // BABYSTEPPING