Browse Source

filter any 0

unknown 10 years ago
parent
commit
c26d816839
1 changed files with 6 additions and 9 deletions
  1. 6
    9
      Marlin/Marlin_main.cpp

+ 6
- 9
Marlin/Marlin_main.cpp View File

@@ -1948,16 +1948,14 @@ inline void gcode_G28() {
1948 1948
 
1949 1949
     // Set the X position, if included
1950 1950
     if (code_seen(axis_codes[X_AXIS]) && code_has_value()) {
1951
-      float v = code_value();
1952
-      if (X_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps
1953
-        current_position[X_AXIS] = v;
1951
+      if (code_value_long() != 0) // filter 0
1952
+        current_position[X_AXIS] = code_value();
1954 1953
     }
1955 1954
 
1956 1955
     // Set the Y position, if included
1957 1956
     if (code_seen(axis_codes[Y_AXIS]) && code_has_value()) {
1958
-      float v = code_value();
1959
-      if (Y_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps
1960
-        current_position[Y_AXIS] = v;
1957
+      if (code_value_long() != 0) // filter 0
1958
+        current_position[X_AXIS] = code_value();
1961 1959
     }
1962 1960
 
1963 1961
     // Home Z last if homing towards the bed
@@ -2045,9 +2043,8 @@ inline void gcode_G28() {
2045 2043
 
2046 2044
     // Set the Z position, if included
2047 2045
     if (code_seen(axis_codes[Z_AXIS]) && code_has_value()) {
2048
-      float v = code_value();
2049
-      if (Z_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps
2050
-      current_position[Z_AXIS] = v;
2046
+      if (code_value_long() != 0) // filter 0
2047
+        current_position[X_AXIS] = code_value();
2051 2048
     }
2052 2049
 
2053 2050
     #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)

Loading…
Cancel
Save