Browse Source

Merge pull request #1945 from Wurstnase/max_endstopp

Max endstopp
Scott Lahteine 10 years ago
parent
commit
3a74bb5039
1 changed files with 12 additions and 6 deletions
  1. 12
    6
      Marlin/Marlin_main.cpp

+ 12
- 6
Marlin/Marlin_main.cpp View File

1943
     if (home_all_axis || homeY) HOMEAXIS(Y);
1943
     if (home_all_axis || homeY) HOMEAXIS(Y);
1944
 
1944
 
1945
     // Set the X position, if included
1945
     // Set the X position, if included
1946
-    if (code_seen(axis_codes[X_AXIS]) && code_has_value())
1947
-      current_position[X_AXIS] = code_value();
1946
+    if (code_seen(axis_codes[X_AXIS]) && code_has_value()) {
1947
+      if (code_value_long() != 0) // filter 0
1948
+        current_position[X_AXIS] = code_value();
1949
+    }
1948
 
1950
 
1949
     // Set the Y position, if included
1951
     // Set the Y position, if included
1950
-    if (code_seen(axis_codes[Y_AXIS]) && code_has_value())
1951
-      current_position[Y_AXIS] = code_value();
1952
+    if (code_seen(axis_codes[Y_AXIS]) && code_has_value()) {
1953
+      if (code_value_long() != 0) // filter 0
1954
+        current_position[Y_AXIS] = code_value();
1955
+    }
1952
 
1956
 
1953
     // Home Z last if homing towards the bed
1957
     // Home Z last if homing towards the bed
1954
     #if Z_HOME_DIR < 0
1958
     #if Z_HOME_DIR < 0
2034
     #endif // Z_HOME_DIR < 0
2038
     #endif // Z_HOME_DIR < 0
2035
 
2039
 
2036
     // Set the Z position, if included
2040
     // Set the Z position, if included
2037
-    if (code_seen(axis_codes[Z_AXIS]) && code_has_value())
2038
-      current_position[Z_AXIS] = code_value();
2041
+    if (code_seen(axis_codes[Z_AXIS]) && code_has_value()) {
2042
+      if (code_value_long() != 0) // filter 0
2043
+        current_position[Z_AXIS] = code_value();
2044
+    }
2039
 
2045
 
2040
     #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)
2046
     #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)
2041
       if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset;  // Add Z_Probe offset (the distance is negative)
2047
       if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset;  // Add Z_Probe offset (the distance is negative)

Loading…
Cancel
Save