🎨 Flags for homing directions
This commit is contained in:
committed by
Scott Lahteine
parent
85fa8c55c9
commit
49b05ba989
@ -814,6 +814,23 @@
|
||||
#endif
|
||||
#endif // FILAMENT_RUNOUT_SENSOR
|
||||
|
||||
// Homing to Min or Max
|
||||
#if X_HOME_DIR > 0
|
||||
#define X_HOME_TO_MAX 1
|
||||
#elif X_HOME_DIR < 0
|
||||
#define X_HOME_TO_MIN 1
|
||||
#endif
|
||||
#if Y_HOME_DIR > 0
|
||||
#define Y_HOME_TO_MAX 1
|
||||
#elif Y_HOME_DIR < 0
|
||||
#define Y_HOME_TO_MIN 1
|
||||
#endif
|
||||
#if Z_HOME_DIR > 0
|
||||
#define Z_HOME_TO_MAX 1
|
||||
#elif Z_HOME_DIR < 0
|
||||
#define Z_HOME_TO_MIN 1
|
||||
#endif
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
#if DISABLED(NOZZLE_AS_PROBE)
|
||||
#define HAS_PROBE_XY_OFFSET 1
|
||||
@ -821,7 +838,7 @@
|
||||
#if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && !BOTH(DELTA, SENSORLESS_PROBING)
|
||||
#define HAS_CUSTOM_PROBE_PIN 1
|
||||
#endif
|
||||
#if Z_HOME_DIR < 0 && (!HAS_CUSTOM_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
|
||||
#if Z_HOME_TO_MIN && (!HAS_CUSTOM_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
|
||||
#define HOMING_Z_WITH_PROBE 1
|
||||
#endif
|
||||
#ifndef Z_PROBE_LOW_POINT
|
||||
@ -843,7 +860,7 @@
|
||||
#undef USE_PROBE_FOR_Z_HOMING
|
||||
#endif
|
||||
|
||||
#if Z_HOME_DIR > 0
|
||||
#if Z_HOME_TO_MAX
|
||||
#define HOME_Z_FIRST // If homing away from BED do Z first
|
||||
#endif
|
||||
|
||||
|
@ -391,6 +391,12 @@
|
||||
#define POLL_JOG
|
||||
#endif
|
||||
|
||||
#if X2_HOME_DIR > 0
|
||||
#define X2_HOME_TO_MAX 1
|
||||
#elif X2_HOME_DIR < 0
|
||||
#define X2_HOME_TO_MIN 1
|
||||
#endif
|
||||
|
||||
#ifndef HOMING_BUMP_MM
|
||||
#define HOMING_BUMP_MM { 0, 0, 0 }
|
||||
#endif
|
||||
|
@ -155,7 +155,7 @@
|
||||
#ifdef MANUAL_X_HOME_POS
|
||||
#define X_HOME_POS MANUAL_X_HOME_POS
|
||||
#else
|
||||
#define X_END_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
|
||||
#define X_END_POS TERN(X_HOME_TO_MIN, X_MIN_POS, X_MAX_POS)
|
||||
#if ENABLED(BED_CENTER_AT_0_0)
|
||||
#define X_HOME_POS TERN(DELTA, 0, X_END_POS)
|
||||
#else
|
||||
@ -166,7 +166,7 @@
|
||||
#ifdef MANUAL_Y_HOME_POS
|
||||
#define Y_HOME_POS MANUAL_Y_HOME_POS
|
||||
#else
|
||||
#define Y_END_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
|
||||
#define Y_END_POS TERN(Y_HOME_TO_MIN, Y_MIN_POS, Y_MAX_POS)
|
||||
#if ENABLED(BED_CENTER_AT_0_0)
|
||||
#define Y_HOME_POS TERN(DELTA, 0, Y_END_POS)
|
||||
#else
|
||||
@ -177,7 +177,7 @@
|
||||
#ifdef MANUAL_Z_HOME_POS
|
||||
#define Z_HOME_POS MANUAL_Z_HOME_POS
|
||||
#else
|
||||
#define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS)
|
||||
#define Z_HOME_POS TERN(Z_HOME_TO_MIN, Z_MIN_POS, Z_MAX_POS)
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -798,7 +798,7 @@
|
||||
* X_DUAL_ENDSTOPS endstop reassignment
|
||||
*/
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
#if X_HOME_DIR > 0
|
||||
#if X_HOME_TO_MAX
|
||||
#ifndef X2_MAX_ENDSTOP_INVERTING
|
||||
#if X2_USE_ENDSTOP == _XMIN_
|
||||
#define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
@ -921,7 +921,7 @@
|
||||
* Y_DUAL_ENDSTOPS endstop reassignment
|
||||
*/
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
#if Y_HOME_DIR > 0
|
||||
#if Y_HOME_TO_MAX
|
||||
#ifndef Y2_MAX_ENDSTOP_INVERTING
|
||||
#if Y2_USE_ENDSTOP == _XMIN_
|
||||
#define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
@ -1045,7 +1045,7 @@
|
||||
*/
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
|
||||
#if Z_HOME_DIR > 0
|
||||
#if Z_HOME_TO_MAX
|
||||
#ifndef Z2_MAX_ENDSTOP_INVERTING
|
||||
#if Z2_USE_ENDSTOP == _XMIN_
|
||||
#define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
@ -1164,7 +1164,7 @@
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if Z_HOME_DIR > 0
|
||||
#if Z_HOME_TO_MAX
|
||||
#ifndef Z3_MAX_ENDSTOP_INVERTING
|
||||
#if Z3_USE_ENDSTOP == _XMIN_
|
||||
#define Z3_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
@ -1284,7 +1284,7 @@
|
||||
#endif
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if Z_HOME_DIR > 0
|
||||
#if Z_HOME_TO_MAX
|
||||
#ifndef Z4_MAX_ENDSTOP_INVERTING
|
||||
#if Z4_USE_ENDSTOP == _XMIN_
|
||||
#define Z4_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
|
@ -1682,7 +1682,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
* Allen Key
|
||||
* Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
|
||||
*/
|
||||
#if BOTH(Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && Z_HOME_DIR < 0
|
||||
#if ALL(Z_HOME_TO_MIN, Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
||||
#error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY."
|
||||
#endif
|
||||
|
||||
@ -1700,7 +1700,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
|
||||
#elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
|
||||
#error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
|
||||
#elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
|
||||
#elif X_HOME_TO_MAX || X2_HOME_TO_MIN
|
||||
#error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
|
||||
#endif
|
||||
#endif
|
||||
@ -2089,25 +2089,25 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
|
||||
// Delta and Cartesian use 3 homing endstops
|
||||
#if NONE(IS_SCARA, SPI_ENDSTOPS)
|
||||
#if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
|
||||
#if X_HOME_TO_MIN && DISABLED(USE_XMIN_PLUG)
|
||||
#error "Enable USE_XMIN_PLUG when homing X to MIN."
|
||||
#elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
|
||||
#elif X_HOME_TO_MAX && DISABLED(USE_XMAX_PLUG)
|
||||
#error "Enable USE_XMAX_PLUG when homing X to MAX."
|
||||
#elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG)
|
||||
#elif Y_HOME_TO_MIN && DISABLED(USE_YMIN_PLUG)
|
||||
#error "Enable USE_YMIN_PLUG when homing Y to MIN."
|
||||
#elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG)
|
||||
#elif Y_HOME_TO_MAX && DISABLED(USE_YMAX_PLUG)
|
||||
#error "Enable USE_YMAX_PLUG when homing Y to MAX."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Z homing direction and plug usage flags
|
||||
#if Z_HOME_DIR < 0 && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE)
|
||||
#if Z_HOME_TO_MIN && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE)
|
||||
#error "Enable USE_ZMIN_PLUG when homing Z to MIN."
|
||||
#elif Z_HOME_DIR > 0 && ENABLED(USE_PROBE_FOR_Z_HOMING)
|
||||
#elif Z_HOME_TO_MAX && ENABLED(USE_PROBE_FOR_Z_HOMING)
|
||||
#error "Z_HOME_DIR must be -1 when homing Z with the probe."
|
||||
#elif BOTH(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS)
|
||||
#error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING."
|
||||
#elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
|
||||
#elif Z_HOME_TO_MAX && DISABLED(USE_ZMAX_PLUG)
|
||||
#error "Enable USE_ZMAX_PLUG when homing Z to MAX."
|
||||
#endif
|
||||
#endif
|
||||
@ -2630,17 +2630,17 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
|
||||
|
||||
#if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
|
||||
#if X_SENSORLESS && X_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_XMIN)
|
||||
#if X_SENSORLESS && X_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_XMIN)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN."
|
||||
#elif X_SENSORLESS && X_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_XMAX)
|
||||
#elif X_SENSORLESS && X_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_XMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX."
|
||||
#elif Y_SENSORLESS && Y_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_YMIN)
|
||||
#elif Y_SENSORLESS && Y_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_YMIN)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN."
|
||||
#elif Y_SENSORLESS && Y_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_YMAX)
|
||||
#elif Y_SENSORLESS && Y_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_YMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX."
|
||||
#elif Z_SENSORLESS && Z_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_ZMIN)
|
||||
#elif Z_SENSORLESS && Z_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_ZMIN)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
|
||||
#elif Z_SENSORLESS && Z_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_ZMAX)
|
||||
#elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
|
||||
#endif
|
||||
#endif
|
||||
@ -2650,37 +2650,37 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust back-offs for better results."
|
||||
#endif
|
||||
#else
|
||||
#if X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
|
||||
#if X_SENSORLESS && X_HOME_TO_MIN && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
|
||||
#if X_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN."
|
||||
#endif
|
||||
#elif X_SENSORLESS && X_HOME_DIR > 0 && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
|
||||
#elif X_SENSORLESS && X_HOME_TO_MAX && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
|
||||
#if X_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX."
|
||||
#endif
|
||||
#elif Y_SENSORLESS && Y_HOME_DIR < 0 && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
|
||||
#elif Y_SENSORLESS && Y_HOME_TO_MIN && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
|
||||
#if Y_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN."
|
||||
#endif
|
||||
#elif Y_SENSORLESS && Y_HOME_DIR > 0 && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
|
||||
#elif Y_SENSORLESS && Y_HOME_TO_MAX && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
|
||||
#if Y_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX."
|
||||
#endif
|
||||
#elif Z_SENSORLESS && Z_HOME_DIR < 0 && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
|
||||
#elif Z_SENSORLESS && Z_HOME_TO_MIN && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
|
||||
#if Z_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN."
|
||||
#endif
|
||||
#elif Z_SENSORLESS && Z_HOME_DIR > 0 && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
|
||||
#elif Z_SENSORLESS && Z_HOME_TO_MAX && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
|
||||
#if Z_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX."
|
||||
#else
|
||||
@ -2918,9 +2918,9 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
#error "POWER_LOSS_RECOVER_ZHOME cannot be used with Z_SAFE_HOMING."
|
||||
#elif BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN)
|
||||
#error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time."
|
||||
#elif ENABLED(POWER_LOSS_RECOVER_ZHOME) && Z_HOME_DIR > 0
|
||||
#elif ENABLED(POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MAX
|
||||
#error "POWER_LOSS_RECOVER_ZHOME is not needed on a machine that homes to ZMAX."
|
||||
#elif BOTH(IS_CARTESIAN, POWER_LOSS_RECOVER_ZHOME) && Z_HOME_DIR < 0 && !defined(POWER_LOSS_ZHOME_POS)
|
||||
#elif BOTH(IS_CARTESIAN, POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MIN && !defined(POWER_LOSS_ZHOME_POS)
|
||||
#error "POWER_LOSS_RECOVER_ZHOME requires POWER_LOSS_ZHOME_POS for a Cartesian that homes to ZMIN."
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user