From 2b86daa30bb4705f8369ca27dd5fe723c90ef634 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Feb 2023 22:29:47 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Tweak=20VALIDATE=5FMESH=5FTILT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index f5c370aa68..354597b601 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -1489,7 +1489,7 @@ void unified_bed_leveling::smart_fill_mesh() { float measured_z; bool abort_flag = false; - #ifdef VALIDATE_MESH_TILT + #if ENABLED(VALIDATE_MESH_TILT) float z1, z2, z3; // Needed for algorithm validation below #endif @@ -1505,9 +1505,7 @@ void unified_bed_leveling::smart_fill_mesh() { abort_flag = true; else { measured_z -= get_z_correction(points[0]); - #ifdef VALIDATE_MESH_TILT - z1 = measured_z; - #endif + TERN_(VALIDATE_MESH_TILT, z1 = measured_z); if (param.V_verbosity > 3) { serial_spaces(16); SERIAL_ECHOLNPGM("Corrected_Z=", measured_z); @@ -1520,9 +1518,7 @@ void unified_bed_leveling::smart_fill_mesh() { TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH))); measured_z = probe.probe_at_point(points[1], PROBE_PT_RAISE, param.V_verbosity); - #ifdef VALIDATE_MESH_TILT - z2 = measured_z; - #endif + TERN_(VALIDATE_MESH_TILT, z2 = measured_z); if (isnan(measured_z)) abort_flag = true; else { @@ -1540,9 +1536,7 @@ void unified_bed_leveling::smart_fill_mesh() { TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH))); measured_z = probe.probe_at_point(points[2], PROBE_PT_LAST_STOW, param.V_verbosity); - #ifdef VALIDATE_MESH_TILT - z3 = measured_z; - #endif + TERN_(VALIDATE_MESH_TILT, z3 = measured_z); if (isnan(measured_z)) abort_flag = true; else { @@ -1689,7 +1683,7 @@ void unified_bed_leveling::smart_fill_mesh() { * The Z error between the probed point locations and the get_z_correction() * numbers for those locations should be 0. */ - #ifdef VALIDATE_MESH_TILT + #if ENABLED(VALIDATE_MESH_TILT) auto d_from = []{ DEBUG_ECHOPGM("D from "); }; auto normed = [&](const xy_pos_t &pos, const_float_t zadd) { return normal.x * pos.x + normal.y * pos.y + zadd;