G28 O respects HOME_AFTER_DEACTIVATE

Addressing #11271
This commit is contained in:
Scott Lahteine 2018-11-05 02:19:55 -06:00
parent 3866aeac52
commit 427bc64ba1
2 changed files with 17 additions and 9 deletions

View file

@ -192,14 +192,22 @@ void GcodeSuite::G28(const bool always_home_all) {
} }
#endif #endif
if (all_axes_known() && parser.boolval('O')) { // home only if needed if (parser.boolval('O')) {
#if ENABLED(DEBUG_LEVELING_FEATURE) if (
if (DEBUGGING(LEVELING)) { #if ENABLED(HOME_AFTER_DEACTIVATE)
SERIAL_ECHOLNPGM("> homing not needed, skip"); all_axes_known() // homing needed anytime steppers deactivate
SERIAL_ECHOLNPGM("<<< G28"); #else
} all_axes_homed() // homing needed only if never homed
#endif #endif
return; ) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOLNPGM("> homing not needed, skip");
SERIAL_ECHOLNPGM("<<< G28");
}
#endif
return;
}
} }
// Wait for planner moves to finish! // Wait for planner moves to finish!

View file

@ -1157,7 +1157,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
#if ENABLED(HOME_AFTER_DEACTIVATE) || ENABLED(Z_SAFE_HOMING) #if ENABLED(HOME_AFTER_DEACTIVATE) || ENABLED(Z_SAFE_HOMING)
#error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING." #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
#endif #endif
#endif // DISABLE_[XYZ] #endif
/** /**
* Filament Width Sensor * Filament Width Sensor