Apply zprobe_zoffset in axis_is_at_home

Ensure the probe offset will always be included when homing Z.
master
Scott Lahteine 10 years ago
parent a0a5ff61c4
commit 0165560333

@ -1034,6 +1034,10 @@ static void axis_is_at_home(int axis) {
min_pos[axis] = base_min_pos(axis) + home_offset[axis]; min_pos[axis] = base_min_pos(axis) + home_offset[axis];
max_pos[axis] = base_max_pos(axis) + home_offset[axis]; max_pos[axis] = base_max_pos(axis) + home_offset[axis];
#endif #endif
#if defined(ENABLE_AUTO_BED_LEVELING) && Z_HOME_DIR < 0
if (axis == Z_AXIS) current_position[Z_AXIS] += zprobe_zoffset;
#endif
} }
/** /**
@ -2042,10 +2046,6 @@ inline void gcode_G28() {
if (code_seen(axis_codes[Z_AXIS]) && code_has_value()) if (code_seen(axis_codes[Z_AXIS]) && code_has_value())
current_position[Z_AXIS] = code_value(); current_position[Z_AXIS] = code_value();
#if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)
if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset; // Add Z_Probe offset (the distance is negative)
#endif
sync_plan_position(); sync_plan_position();
#endif // else DELTA #endif // else DELTA

Loading…
Cancel
Save