1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-12-18 00:07:50 +00:00

filter any 0

This commit is contained in:
unknown 2015-04-22 12:09:57 +02:00
parent 61ae43f35e
commit c26d816839

View File

@ -1948,16 +1948,14 @@ inline void gcode_G28() {
// Set the X position, if included // Set the X position, if included
if (code_seen(axis_codes[X_AXIS]) && code_has_value()) { if (code_seen(axis_codes[X_AXIS]) && code_has_value()) {
float v = code_value(); if (code_value_long() != 0) // filter 0
if (X_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps current_position[X_AXIS] = code_value();
current_position[X_AXIS] = v;
} }
// Set the Y position, if included // Set the Y position, if included
if (code_seen(axis_codes[Y_AXIS]) && code_has_value()) { if (code_seen(axis_codes[Y_AXIS]) && code_has_value()) {
float v = code_value(); if (code_value_long() != 0) // filter 0
if (Y_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps current_position[X_AXIS] = code_value();
current_position[Y_AXIS] = v;
} }
// Home Z last if homing towards the bed // Home Z last if homing towards the bed
@ -2045,9 +2043,8 @@ inline void gcode_G28() {
// Set the Z position, if included // Set the Z position, if included
if (code_seen(axis_codes[Z_AXIS]) && code_has_value()) { if (code_seen(axis_codes[Z_AXIS]) && code_has_value()) {
float v = code_value(); if (code_value_long() != 0) // filter 0
if (Z_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps current_position[X_AXIS] = code_value();
current_position[Z_AXIS] = v;
} }
#if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0) #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)