diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 6b8a682ac6..844d2a4e54 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -842,5 +842,20 @@ #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 #endif #endif + + /** + * MIN_Z_HEIGHT_FOR_HOMING / Z_RAISE_BETWEEN_PROBINGS + */ + #ifndef MIN_Z_HEIGHT_FOR_HOMING + #ifndef Z_RAISE_BETWEEN_PROBINGS + #define MIN_Z_HEIGHT_FOR_HOMING 0 + #else + #define MIN_Z_HEIGHT_FOR_HOMING Z_RAISE_BETWEEN_PROBINGS + #endif + #endif + #ifndef Z_RAISE_BETWEEN_PROBINGS + #define Z_RAISE_BETWEEN_PROBING MIN_Z_HEIGHT_FOR_HOMING + #endif + #endif //CONFIGURATION_LCD #endif //CONDITIONALS_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 160274c112..ef01f1226b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2892,7 +2892,7 @@ inline void gcode_G28() { #endif } - #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0 + #else if (home_all_axis || homeX || homeY) { // Raise Z before homing any other axes and z is not already high enough (never lower z) @@ -2913,7 +2913,7 @@ inline void gcode_G28() { } } - #endif // MIN_Z_HEIGHT_FOR_HOMING + #endif #if ENABLED(QUICK_HOME) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 87104d87ec..e7a59d4cc5 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -978,17 +978,13 @@ static void lcd_status_screen() { // Note: During Manual Bed Leveling the homed Z position is MESH_HOME_SEARCH_Z // Z position will be restored with the final action, a G28 inline void _mbl_goto_xy(float x, float y) { - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - #if MIN_Z_HEIGHT_FOR_HOMING > 0 - + MIN_Z_HEIGHT_FOR_HOMING - #endif - ; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + MIN_Z_HEIGHT_FOR_HOMING; line_to_current(Z_AXIS); current_position[X_AXIS] = x + home_offset[X_AXIS]; current_position[Y_AXIS] = y + home_offset[Y_AXIS]; line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS); #if MIN_Z_HEIGHT_FOR_HOMING > 0 - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; // How do condition and action match? line_to_current(Z_AXIS); #endif stepper.synchronize(); @@ -1038,11 +1034,7 @@ static void lcd_status_screen() { if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) { lcd_goto_screen(_lcd_level_bed_done, true); - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - #if MIN_Z_HEIGHT_FOR_HOMING > 0 - + MIN_Z_HEIGHT_FOR_HOMING - #endif - ; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + MIN_Z_HEIGHT_FOR_HOMING; line_to_current(Z_AXIS); stepper.synchronize();