From fcd4fa4ab706bfb3ba33639795e202c2b54a1719 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 13 Aug 2020 03:39:59 -0500 Subject: [PATCH] Clean up G34/M422 --- Marlin/src/gcode/calibrate/G34_M422.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 922e01d3e4..07fb6a3fff 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -51,6 +51,9 @@ #include "../../libs/least_squares_fit.h" #endif +#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) +#include "../../core/debug_out.h" + /** * G34: Z-Stepper automatic alignment * @@ -602,12 +605,13 @@ void GcodeSuite::M422() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Final Z Move"); do_blocking_move_to_z(zgrind, MMM_TO_MMS(GANTRY_CALIBRATION_FEEDRATE)); - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Backoff"); // Back off end plate, back to normal motion range if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Backoff"); do_blocking_move_to_z(zpounce, MMM_TO_MMS(GANTRY_CALIBRATION_FEEDRATE)); + #if _REDUCE_CURRENT + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Restore Current"); + #endif if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Restore Current"); // Reset current to original values @@ -639,8 +643,6 @@ void GcodeSuite::M422() { #endif #endif - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Running Post Commands"); #ifdef GANTRY_CALIBRATION_COMMANDS_POST if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Running Post Commands"); gcode.process_subcommands_now_P(PSTR(GANTRY_CALIBRATION_COMMANDS_POST));