diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index e0b7965a2f..c9645c0d32 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -22,10 +22,6 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(Z_STEPPER_AUTO_ALIGN) - -#include "../../feature/z_stepper_align.h" - #include "../gcode.h" #include "../../module/planner.h" #include "../../module/stepper.h" @@ -41,13 +37,20 @@ #include "../../module/tool_change.h" #endif -#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - #include "../../libs/least_squares_fit.h" -#endif + #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../core/debug_out.h" +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + + +#include "../../feature/z_stepper_align.h" + +#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #include "../../libs/least_squares_fit.h" +#endif + /** * G34: Z-Stepper automatic alignment * @@ -513,7 +516,7 @@ void GcodeSuite::M422() { void GcodeSuite::G34() { - if (axis_unhomed_error()) return; + if (homing_needed()) return; TEMPORARY_SOFT_ENDSTOP_STATE(false); TEMPORARY_BED_LEVELING_STATE(false);