🎨 Flags for homing directions
This commit is contained in:
committed by
Scott Lahteine
parent
0dae140080
commit
49771c4a9e
@@ -513,14 +513,8 @@ void Endstops::update() {
|
||||
#endif
|
||||
|
||||
// With Dual X, endstops are only checked in the homing direction for the active extruder
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
#define E0_ACTIVE stepper.last_moved_extruder == 0
|
||||
#define X_MIN_TEST() ((X_HOME_DIR < 0 && E0_ACTIVE) || (X2_HOME_DIR < 0 && !E0_ACTIVE))
|
||||
#define X_MAX_TEST() ((X_HOME_DIR > 0 && E0_ACTIVE) || (X2_HOME_DIR > 0 && !E0_ACTIVE))
|
||||
#else
|
||||
#define X_MIN_TEST() true
|
||||
#define X_MAX_TEST() true
|
||||
#endif
|
||||
#define X_MIN_TEST() TERN1(DUAL_X_CARRIAGE, TERN0(X_HOME_TO_MIN, stepper.last_moved_extruder == 0) || TERN0(X2_HOME_TO_MIN, stepper.last_moved_extruder != 0))
|
||||
#define X_MAX_TEST() TERN1(DUAL_X_CARRIAGE, TERN0(X_HOME_TO_MAX, stepper.last_moved_extruder == 0) || TERN0(X2_HOME_TO_MAX, stepper.last_moved_extruder != 0))
|
||||
|
||||
// Use HEAD for core axes, AXIS for others
|
||||
#if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
|
||||
@@ -765,7 +759,7 @@ void Endstops::update() {
|
||||
|
||||
if (stepper.axis_is_moving(X_AXIS)) {
|
||||
if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction
|
||||
#if HAS_X_MIN || (X_SPI_SENSORLESS && X_HOME_DIR < 0)
|
||||
#if HAS_X_MIN || (X_SPI_SENSORLESS && X_HOME_TO_MIN)
|
||||
PROCESS_ENDSTOP_X(MIN);
|
||||
#if CORE_DIAG(XY, Y, MIN)
|
||||
PROCESS_CORE_ENDSTOP(Y,MIN,X,MIN);
|
||||
@@ -779,7 +773,7 @@ void Endstops::update() {
|
||||
#endif
|
||||
}
|
||||
else { // +direction
|
||||
#if HAS_X_MAX || (X_SPI_SENSORLESS && X_HOME_DIR > 0)
|
||||
#if HAS_X_MAX || (X_SPI_SENSORLESS && X_HOME_TO_MAX)
|
||||
PROCESS_ENDSTOP_X(MAX);
|
||||
#if CORE_DIAG(XY, Y, MIN)
|
||||
PROCESS_CORE_ENDSTOP(Y,MIN,X,MAX);
|
||||
@@ -796,7 +790,7 @@ void Endstops::update() {
|
||||
|
||||
if (stepper.axis_is_moving(Y_AXIS)) {
|
||||
if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction
|
||||
#if HAS_Y_MIN || (Y_SPI_SENSORLESS && Y_HOME_DIR < 0)
|
||||
#if HAS_Y_MIN || (Y_SPI_SENSORLESS && Y_HOME_TO_MIN)
|
||||
PROCESS_ENDSTOP_Y(MIN);
|
||||
#if CORE_DIAG(XY, X, MIN)
|
||||
PROCESS_CORE_ENDSTOP(X,MIN,Y,MIN);
|
||||
@@ -810,7 +804,7 @@ void Endstops::update() {
|
||||
#endif
|
||||
}
|
||||
else { // +direction
|
||||
#if HAS_Y_MAX || (Y_SPI_SENSORLESS && Y_HOME_DIR > 0)
|
||||
#if HAS_Y_MAX || (Y_SPI_SENSORLESS && Y_HOME_TO_MAX)
|
||||
PROCESS_ENDSTOP_Y(MAX);
|
||||
#if CORE_DIAG(XY, X, MIN)
|
||||
PROCESS_CORE_ENDSTOP(X,MIN,Y,MAX);
|
||||
@@ -828,7 +822,7 @@ void Endstops::update() {
|
||||
if (stepper.axis_is_moving(Z_AXIS)) {
|
||||
if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up.
|
||||
|
||||
#if HAS_Z_MIN || (Z_SPI_SENSORLESS && Z_HOME_DIR < 0)
|
||||
#if HAS_Z_MIN || (Z_SPI_SENSORLESS && Z_HOME_TO_MIN)
|
||||
if ( TERN1(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, z_probe_enabled)
|
||||
&& TERN1(HAS_CUSTOM_PROBE_PIN, !z_probe_enabled)
|
||||
) PROCESS_ENDSTOP_Z(MIN);
|
||||
@@ -849,7 +843,7 @@ void Endstops::update() {
|
||||
#endif
|
||||
}
|
||||
else { // Z +direction. Gantry up, bed down.
|
||||
#if HAS_Z_MAX || (Z_SPI_SENSORLESS && Z_HOME_DIR > 0)
|
||||
#if HAS_Z_MAX || (Z_SPI_SENSORLESS && Z_HOME_TO_MAX)
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
PROCESS_ENDSTOP_Z(MAX);
|
||||
#elif !HAS_CUSTOM_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN // No probe or probe is Z_MIN || Probe is not Z_MAX
|
||||
|
||||
Reference in New Issue
Block a user