Fixes #6828: M428 bug

This commit is contained in:
Scott Lahteine 2017-05-22 17:34:03 -05:00
parent 48f7652143
commit ceb62fc7e1

View File

@ -8740,10 +8740,10 @@ void quickstop_stepper() {
bool err = false;
LOOP_XYZ(i) {
if (axis_homed[i]) {
float base = (current_position[i] > (soft_endstop_min[i] + soft_endstop_max[i]) * 0.5) ? base_home_pos((AxisEnum)i) : 0,
diff = current_position[i] - LOGICAL_POSITION(base, i);
const float base = (current_position[i] > (soft_endstop_min[i] + soft_endstop_max[i]) * 0.5) ? base_home_pos((AxisEnum)i) : 0,
diff = base - RAW_POSITION(current_position[i], i);
if (WITHIN(diff, -20, 20)) {
set_home_offset((AxisEnum)i, home_offset[i] - diff);
set_home_offset((AxisEnum)i, diff);
}
else {
SERIAL_ERROR_START;