From 03dd12cc6b32bce2a12bc78430a6eb8e2cfb1e3d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 19 May 2022 06:19:22 -0500 Subject: [PATCH] cleanup --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index e212ac4edc63d..8eaeb8e6365cd 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -729,6 +729,7 @@ G29_TYPE GcodeSuite::G29() { #endif + abl.reenable = false; // Don't re-enable after modifying the mesh idle_no_sleep(); } // inner @@ -916,22 +917,17 @@ G29_TYPE GcodeSuite::G29() { } // Auto Bed Leveling is complete! Enable if possible. - planner.leveling_active = !abl.dryrun || abl.reenable; - // Sync the planner from the current_position - if (planner.leveling_active) sync_plan_position(); - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (!abl.dryrun || abl.reenable) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("G29 uncorrected Z:", current_position.z); + planner.leveling_active = true; + sync_plan_position(); + } - // Auto Bed Leveling is complete! Enable if possible. - set_bed_leveling_enabled(true); + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(" corrected Z:", current_position.z); - } + // Auto Bed Leveling is complete! Enable if possible. + if (!abl.dryrun || abl.reenable) set_bed_leveling_enabled(true); - #endif // ABL_PLANAR + #endif } // !isnan(abl.measured_z)