1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-12-18 00:07:50 +00:00

Don't include Z_RAISE_AFTER_PROBING if not used (PR#2527)

This commit is contained in:
Scott Lahteine 2015-07-26 14:41:48 -07:00 committed by Richard Wackerbarth
parent 81bba7ed88
commit bea6739774

View File

@ -1425,8 +1425,11 @@ static void setup_for_endstop_move() {
// Move up for safety
feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
#if Z_RAISE_AFTER_PROBING > 0
destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
prepare_move_raw(); // this will also set_current_to_destination
#endif
// Move to the start position to initiate retraction
destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X;
@ -1610,7 +1613,9 @@ static void setup_for_endstop_move() {
float oldXpos = current_position[X_AXIS]; // save x position
if (dock) {
#if Z_RAISE_AFTER_PROBING > 0
do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // raise Z
#endif
do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); // Dock sled a bit closer to ensure proper capturing
digitalWrite(SLED_PIN, LOW); // turn off magnet
} else {
@ -2766,7 +2771,11 @@ inline void gcode_G28() {
// adjust for inaccurate endstops, not for reasonably accurate probes. If it were
// added here, it could be seen as a compensating factor for the Z probe.
//
current_position[Z_AXIS] = -zprobe_zoffset + Z_RAISE_AFTER_PROBING + (z_tmp - real_z);
current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z)
#if ENABLED(SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED)
+ Z_RAISE_AFTER_PROBING
#endif
;
// current_position[Z_AXIS] += home_offset[Z_AXIS]; // The probe determines Z=0, not "Z home"
sync_plan_position();
}