From d9e1cbebeae11a6be4efb96c8c48401809852192 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 20 Mar 2018 18:04:22 -0500 Subject: [PATCH] Tweak use of move_z_after_probing --- Marlin/Marlin.h | 4 +--- Marlin/Marlin_main.cpp | 19 +++++++++++++------ Marlin/ubl_G29.cpp | 5 ++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 250afccbba..edd9bbc6cf 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -384,10 +384,8 @@ void report_current_position(); #if HAS_BED_PROBE extern float zprobe_zoffset; bool set_probe_deployed(const bool deploy); - #ifdef Z_AFTER_PROBING + #if Z_AFTER_PROBING void move_z_after_probing(); - #else - inline void move_z_after_probing() {} #endif enum ProbePtRaise : unsigned char { PROBE_PT_NONE, // No raise or stow after run_z_probe diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 106a1303b7..ed8f3837bb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3851,7 +3851,7 @@ inline void gcode_G4() { #endif // DELTA -#ifdef Z_AFTER_PROBING +#if Z_AFTER_PROBING void move_z_after_probing() { if (current_position[Z_AXIS] != Z_AFTER_PROBING) { do_blocking_move_to_z(Z_AFTER_PROBING); @@ -4092,7 +4092,7 @@ inline void gcode_G28(const bool always_home_all) { HOMEAXIS(Z); #endif - #if HOMING_Z_WITH_PROBE + #if HOMING_Z_WITH_PROBE && Z_AFTER_PROBING move_z_after_probing(); #endif @@ -5249,7 +5249,7 @@ void home_all_axes() { gcode_G28(true); } if (planner.leveling_active) SYNC_PLAN_POSITION_KINEMATIC(); - #if HAS_BED_PROBE + #if HAS_BED_PROBE && Z_AFTER_PROBING move_z_after_probing(); #endif @@ -5293,7 +5293,9 @@ void home_all_axes() { gcode_G28(true); } clean_up_after_endstop_or_probe_move(); - if (raise_after == PROBE_PT_STOW) move_z_after_probing(); + #if Z_AFTER_PROBING + if (raise_after == PROBE_PT_STOW) move_z_after_probing(); + #endif report_current_position(); } @@ -7599,7 +7601,10 @@ inline void gcode_M42() { set_bed_leveling_enabled(was_enabled); #endif - move_z_after_probing(); + #if Z_AFTER_PROBING + move_z_after_probing(); + #endif + report_current_position(); } @@ -9687,7 +9692,9 @@ inline void gcode_M400() { stepper.synchronize(); } */ inline void gcode_M402() { STOW_PROBE(); - move_z_after_probing(); + #if Z_AFTER_PROBING + move_z_after_probing(); + #endif report_current_position(); } diff --git a/Marlin/ubl_G29.cpp b/Marlin/ubl_G29.cpp index 6750b2b415..ecc3c7da9d 100644 --- a/Marlin/ubl_G29.cpp +++ b/Marlin/ubl_G29.cpp @@ -752,7 +752,10 @@ } while (location.x_index >= 0 && --max_iterations); STOW_PROBE(); - move_z_after_probing(); + + #if Z_AFTER_PROBING + move_z_after_probing(); + #endif restore_ubl_active_state_and_leave();