1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-24 04:29:34 +00:00

Apply zprobe_zoffset in axis_is_at_home

Ensure the probe offset will always be included when homing Z.
This commit is contained in:
Scott Lahteine 2015-04-16 07:41:19 -07:00
parent a0a5ff61c4
commit 0165560333

View File

@ -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