From a5c20a1c6e632bfe15ef7df350b7b28be4bd621a Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Fri, 5 May 2023 18:03:57 +0200 Subject: [PATCH] Do not plan a Z move if no move is actually performed --- Firmware/Marlin_main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index c41124ba9..5d926ec54 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -2915,10 +2915,11 @@ static void gcode_G80() // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; - if (init_z_bckp > current_position[Z_AXIS]) + if (init_z_bckp > current_position[Z_AXIS]) { current_position[Z_AXIS] = init_z_bckp; - plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); - st_synchronize(); + plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); + st_synchronize(); + } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos;