Option to force X or Y to home first when homing the other axis

This commit is contained in:
Kevin
2018-02-16 16:59:44 +01:00
committed by Scott Lahteine
parent 60fc372211
commit 9019ea0fce
4 changed files with 28 additions and 9 deletions

View File

@ -362,6 +362,9 @@
// When G28 is called, this option will make Y home before X
//#define HOME_Y_BEFORE_X
// Enable this if X or Y can't home without homing the other axis first.
//#define CODEPENDENT_XY_HOMING
// @section machine
#define AXIS_RELATIVE_MODES {false, false, false, false}

View File

@ -227,10 +227,14 @@ void GcodeSuite::G28(const bool always_home_all) {
#endif
// Home Y (before X)
#if ENABLED(HOME_Y_BEFORE_X)
// Home Y
if (home_all || homeY) {
if (home_all || homeY
#if ENABLED(CODEPENDENT_XY_HOMING)
|| homeX
#endif
) {
HOMEAXIS(Y);
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
@ -240,7 +244,11 @@ void GcodeSuite::G28(const bool always_home_all) {
#endif
// Home X
if (home_all || homeX) {
if (home_all || homeX
#if ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X)
|| homeY
#endif
) {
#if ENABLED(DUAL_X_CARRIAGE)
@ -271,8 +279,8 @@ void GcodeSuite::G28(const bool always_home_all) {
#endif
}
// Home Y (after X)
#if DISABLED(HOME_Y_BEFORE_X)
// Home Y
if (home_all || homeY) {
HOMEAXIS(Y);
#if ENABLED(DEBUG_LEVELING_FEATURE)

View File

@ -886,12 +886,20 @@ static_assert(1 >= 0
#endif
/**
* Homing Bump
* Homing
*/
#if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0
#error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0."
#endif
#if ENABLED(CODEPENDENT_XY_HOMING)
#if ENABLED(QUICK_HOME)
#error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
#elif IS_KINEMATIC
#error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
#endif
#endif
/**
* Make sure Z_SAFE_HOMING point is reachable
*/