Fix Babystepping loop (again)
This commit is contained in:
@@ -35,17 +35,17 @@
|
||||
|
||||
Babystep babystep;
|
||||
|
||||
volatile int16_t Babystep::steps[BS_TODO_AXIS(Z_AXIS) + 1];
|
||||
volatile int16_t Babystep::steps[BS_AXIS_IND(Z_AXIS) + 1];
|
||||
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
||||
int16_t Babystep::axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
|
||||
#endif
|
||||
int16_t Babystep::accum;
|
||||
|
||||
void Babystep::step_axis(const AxisEnum axis) {
|
||||
const int16_t curTodo = steps[BS_TODO_AXIS(axis)]; // get rid of volatile for performance
|
||||
const int16_t curTodo = steps[BS_AXIS_IND(axis)]; // get rid of volatile for performance
|
||||
if (curTodo) {
|
||||
stepper.do_babystep((AxisEnum)axis, curTodo > 0);
|
||||
if (curTodo > 0) steps[BS_TODO_AXIS(axis)]--; else steps[BS_TODO_AXIS(axis)]++;
|
||||
if (curTodo > 0) steps[BS_AXIS_IND(axis)]--; else steps[BS_AXIS_IND(axis)]++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
|
||||
#else
|
||||
BSA_ENABLE(Z_AXIS);
|
||||
#endif
|
||||
steps[BS_TODO_AXIS(axis)] += distance;
|
||||
steps[BS_AXIS_IND(axis)] += distance;
|
||||
#endif
|
||||
#if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
|
||||
gcode.reset_stepper_timeout();
|
||||
|
||||
Reference in New Issue
Block a user