|
@@ -1947,12 +1947,18 @@ inline void gcode_G28() {
|
1947
|
1947
|
if (home_all_axis || homeY) HOMEAXIS(Y);
|
1948
|
1948
|
|
1949
|
1949
|
// Set the X position, if included
|
1950
|
|
- if (code_seen(axis_codes[X_AXIS]) && code_has_value())
|
1951
|
|
- current_position[X_AXIS] = code_value();
|
|
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;
|
|
1954
|
+ }
|
1952
|
1955
|
|
1953
|
1956
|
// Set the Y position, if included
|
1954
|
|
- if (code_seen(axis_codes[Y_AXIS]) && code_has_value())
|
1955
|
|
- current_position[Y_AXIS] = code_value();
|
|
1957
|
+ 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] = code_value();
|
|
1961
|
+ }
|
1956
|
1962
|
|
1957
|
1963
|
// Home Z last if homing towards the bed
|
1958
|
1964
|
#if Z_HOME_DIR < 0
|
|
@@ -2038,8 +2044,11 @@ inline void gcode_G28() {
|
2038
|
2044
|
#endif // Z_HOME_DIR < 0
|
2039
|
2045
|
|
2040
|
2046
|
// Set the Z position, if included
|
2041
|
|
- if (code_seen(axis_codes[Z_AXIS]) && code_has_value())
|
|
2047
|
+ 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
|
2042
|
2050
|
current_position[Z_AXIS] = code_value();
|
|
2051
|
+ }
|
2043
|
2052
|
|
2044
|
2053
|
#if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)
|
2045
|
2054
|
if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset; // Add Z_Probe offset (the distance is negative)
|