From ce44bee28bb7854ec138464a4b17828ebc7b2327 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Mar 2015 19:45:14 -0700 Subject: [PATCH] Small code reduction --- Marlin/Marlin_main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7726ca52ef..6802a82518 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2382,16 +2382,17 @@ inline void gcode_G28() { #else // !AUTO_BED_LEVELING_GRID - // Probe at 3 arbitrary points - float z_at_pt_1, z_at_pt_2, z_at_pt_3; + // Actions for each probe ProbeAction p1, p2, p3; if (engage_probe_for_each_reading) p1 = p2 = p3 = ProbeEngageAndRetract; else p1 = ProbeEngage, p2 = ProbeStay, p3 = ProbeRetract; - z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, p1, verbose_level); - z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p2, verbose_level); - z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p3, verbose_level); + + // Probe at 3 arbitrary points + float z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, p1, verbose_level), + z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p2, verbose_level), + z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p3, verbose_level); clean_up_after_endstop_move(); if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);