max endstopp

no user will home to 0 with a max endstopp
This commit is contained in:
Wurstnase 2015-04-20 23:28:46 +02:00
parent a4ca87ba99
commit da0d91a79b

View file

@ -1947,12 +1947,18 @@ inline void gcode_G28() {
if (home_all_axis || homeY) HOMEAXIS(Y); if (home_all_axis || homeY) HOMEAXIS(Y);
// 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()) {
current_position[X_AXIS] = code_value(); float v = code_value();
if (X_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps
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 (Y_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps
current_position[Y_AXIS] = code_value(); current_position[Y_AXIS] = code_value();
}
// Home Z last if homing towards the bed // Home Z last if homing towards the bed
#if Z_HOME_DIR < 0 #if Z_HOME_DIR < 0
@ -2038,8 +2044,11 @@ inline void gcode_G28() {
#endif // Z_HOME_DIR < 0 #endif // Z_HOME_DIR < 0
// 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 (Z_HOME_DIR == -1 || v != 0) // filter 0 with max-endstopps
current_position[Z_AXIS] = code_value(); current_position[Z_AXIS] = code_value();
}
#if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0) #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)
if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset; // Add Z_Probe offset (the distance is negative) if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset; // Add Z_Probe offset (the distance is negative)