From c26d816839e556876522595e85c6aadd43c05844 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Apr 2015 12:09:57 +0200 Subject: [PATCH] filter any 0 --- Marlin/Marlin_main.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4987aaf1e2..952aa2fb3e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1948,16 +1948,14 @@ inline void gcode_G28() { // Set the X position, if included if (code_seen(axis_codes[X_AXIS]) && code_has_value()) { - float v = code_value(); - if (X_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps - current_position[X_AXIS] = v; + if (code_value_long() != 0) // filter 0 + current_position[X_AXIS] = code_value(); } // Set the Y position, if included if (code_seen(axis_codes[Y_AXIS]) && code_has_value()) { - float v = code_value(); - if (Y_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps - current_position[Y_AXIS] = v; + if (code_value_long() != 0) // filter 0 + current_position[X_AXIS] = code_value(); } // Home Z last if homing towards the bed @@ -2045,9 +2043,8 @@ inline void gcode_G28() { // Set the Z position, if included if (code_seen(axis_codes[Z_AXIS]) && code_has_value()) { - float v = code_value(); - if (Z_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps - current_position[Z_AXIS] = v; + if (code_value_long() != 0) // filter 0 + current_position[X_AXIS] = code_value(); } #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)