0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-03-10 08:32:54 +00:00

🔧 Fix USE_Z_MIN conditions ()

This commit is contained in:
Taylor Talkington 2024-02-04 10:03:08 -05:00 committed by GitHub
parent 7f4792e47c
commit 755b661c2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -1957,8 +1957,9 @@
* Currently this must be distinct, but we can add a mechanism to use the same pin for sensorless
* or switches wired to the same pin, or for the single SPI stall state on the axis.
*/
#define _USE_STOP(A,N,M,C) ((ANY(A##_HOME_TO_##M, A##N##_SAFETY_STOP) || (C+0)) && PIN_EXISTS(A##N##_##M) && !A##_SPI_SENSORLESS)
#define _HAS_STATE(A,N,M) (USE_##A##N##_##M || (ANY(A##_HOME_TO_##M, A##N##_SAFETY_STOP) && A##_SPI_SENSORLESS))
#define _ANY_STOP(A,N,M) ANY(A##_HOME_TO_##M, A##N##_SAFETY_STOP)
#define _USE_STOP(A,N,M,C) ((_ANY_STOP(A,N,M) || (C+0)) && PIN_EXISTS(A##N##_##M) && !A##_SPI_SENSORLESS)
#define _HAS_STATE(A,N,M) (USE_##A##N##_##M || (_ANY_STOP(A,N,M) && A##_SPI_SENSORLESS))
#if _USE_STOP(X,,MIN,)
#define USE_X_MIN 1
@ -1992,7 +1993,7 @@
#define HAS_Y_STATE 1
#endif
#if _USE_STOP(Z,,MIN,ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))
#if _USE_STOP(Z,,MIN,ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) && (DISABLED(USE_PROBE_FOR_Z_HOMING) || ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))
#define USE_Z_MIN 1
#endif
#if _USE_STOP(Z,,MAX,)
@ -2199,7 +2200,9 @@
#define HAS_Z_PROBE_STATE 1
#endif
#undef _ANY_STOP
#undef _USE_STOP
#undef _HAS_STATE
/**
* Set ENDSTOPPULLUPS for active endstop switches

View file

@ -2384,8 +2384,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#error "Y_MIN_PIN, Y_STOP_PIN, or Y_SPI_SENSORLESS is required for Y axis homing."
#elif Y_HOME_TO_MAX && !HAS_Y_MAX_STATE
#error "Y_MAX_PIN, Y_STOP_PIN, or Y_SPI_SENSORLESS is required for Y axis homing."
#elif Z_HOME_TO_MIN && !HAS_Z_MIN_STATE
#error "Z_MIN_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Z axis homing."
#elif Z_HOME_TO_MIN && NONE(HAS_Z_MIN_STATE, USE_PROBE_FOR_Z_HOMING)
#error "Z_MIN_PIN, Z_STOP_PIN, Z_SPI_SENSORLESS, or USE_PROBE_FOR_Z_HOMING is required for Z axis homing."
#elif Z_HOME_TO_MAX && !HAS_Z_MAX_STATE
#error "Z_MAX_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Z axis homing."
#elif I_HOME_TO_MIN && !HAS_I_MIN_STATE