🔧 HAS_CUSTOM_PROBE_PIN => USES_Z_MIN_PROBE_PIN

This commit is contained in:
Scott Lahteine 2021-07-28 23:24:30 -05:00 committed by Scott Lahteine
parent 381c5908b4
commit 80f8ec94aa
9 changed files with 19 additions and 19 deletions

View File

@ -146,7 +146,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#error "Serial port pins (2) conflict with other pins!"
#elif Y_HOME_TO_MIN && IS_TX2(Y_STOP_PIN)
#error "Serial port pins (2) conflict with Y endstop pin!"
#elif HAS_CUSTOM_PROBE_PIN && IS_TX2(Z_MIN_PROBE_PIN)
#elif USES_Z_MIN_PROBE_PIN && IS_TX2(Z_MIN_PROBE_PIN)
#error "Serial port pins (2) conflict with probe pin!"
#elif ANY_TX(2, X_ENABLE_PIN, Y_ENABLE_PIN) || ANY_RX(2, X_DIR_PIN, Y_DIR_PIN)
#error "Serial port pins (2) conflict with X/Y stepper pins!"
@ -237,7 +237,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#define PIN_IS_SCL2(P) (P##_PIN == P0_11)
#if PIN_IS_SDA2(Y_STOP)
#error "i2c SDA2 overlaps with Y endstop pin!"
#elif HAS_CUSTOM_PROBE_PIN && PIN_IS_SDA2(Z_MIN_PROBE)
#elif USES_Z_MIN_PROBE_PIN && PIN_IS_SDA2(Z_MIN_PROBE)
#error "i2c SDA2 overlaps with Z probe pin!"
#elif PIN_IS_SDA2(X_ENABLE) || PIN_IS_SDA2(Y_ENABLE)
#error "i2c SDA2 overlaps with X/Y ENABLE pin!"

View File

@ -911,9 +911,9 @@
#define HAS_PROBE_XY_OFFSET 1
#endif
#if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && !BOTH(DELTA, SENSORLESS_PROBING)
#define HAS_CUSTOM_PROBE_PIN 1
#define USES_Z_MIN_PROBE_PIN 1
#endif
#if Z_HOME_TO_MIN && (!HAS_CUSTOM_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
#if Z_HOME_TO_MIN && (!USES_Z_MIN_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
#define HOMING_Z_WITH_PROBE 1
#endif
#ifndef Z_PROBE_LOW_POINT

View File

@ -2459,7 +2459,7 @@
//
// Is an endstop plug used for extra Z endstops or the probe?
#define IS_PROBE_PIN(A,M) (HAS_CUSTOM_PROBE_PIN && Z_MIN_PROBE_PIN == A##_##M##_PIN)
#define IS_PROBE_PIN(A,M) (USES_Z_MIN_PROBE_PIN && Z_MIN_PROBE_PIN == A##_##M##_PIN)
#define IS_X2_ENDSTOP(A,M) (ENABLED(X_DUAL_ENDSTOPS) && X2_USE_ENDSTOP == _##A##M##_)
#define IS_Y2_ENDSTOP(A,M) (ENABLED(Y_DUAL_ENDSTOPS) && Y2_USE_ENDSTOP == _##A##M##_)
#define IS_Z2_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && Z2_USE_ENDSTOP == _##A##M##_)
@ -2533,7 +2533,7 @@
#if PIN_EXISTS(Z4_MAX)
#define HAS_Z4_MAX 1
#endif
#if BOTH(HAS_BED_PROBE, HAS_CUSTOM_PROBE_PIN) && PIN_EXISTS(Z_MIN_PROBE)
#if BOTH(HAS_BED_PROBE, USES_Z_MIN_PROBE_PIN) && PIN_EXISTS(Z_MIN_PROBE)
#define HAS_Z_MIN_PROBE_PIN 1
#endif

View File

@ -329,7 +329,7 @@ void Endstops::init() {
#endif
#endif
#if HAS_CUSTOM_PROBE_PIN
#if USES_Z_MIN_PROBE_PIN
#if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE)
SET_INPUT_PULLUP(Z_MIN_PROBE_PIN);
#elif ENABLED(ENDSTOPPULLDOWN_ZMIN_PROBE)
@ -453,7 +453,7 @@ void Endstops::event_handler() {
_ENDSTOP_HIT_TEST(K,'K')
);
#if HAS_CUSTOM_PROBE_PIN
#if USES_Z_MIN_PROBE_PIN
#define P_AXIS Z_AXIS
if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P');
#endif
@ -566,7 +566,7 @@ void _O2 Endstops::report_states() {
#if BOTH(MARLIN_DEV_MODE, PROBE_ACTIVATION_SWITCH)
print_es_state(probe_switch_activated(), PSTR(STR_PROBE_EN));
#endif
#if HAS_CUSTOM_PROBE_PIN
#if USES_Z_MIN_PROBE_PIN
print_es_state(PROBE_TRIGGERED(), PSTR(STR_Z_PROBE));
#endif
#if MULTI_FILAMENT_SENSOR
@ -720,7 +720,7 @@ void Endstops::update() {
#if HAS_BED_PROBE
// When closing the gap check the enabled probe
if (probe_switch_activated())
UPDATE_ENDSTOP_BIT(Z, TERN(HAS_CUSTOM_PROBE_PIN, MIN_PROBE, MIN));
UPDATE_ENDSTOP_BIT(Z, TERN(USES_Z_MIN_PROBE_PIN, MIN_PROBE, MIN));
#endif
#if HAS_Z_MAX && !Z_SPI_SENSORLESS
@ -746,7 +746,7 @@ void Endstops::update() {
COPY_LIVE_STATE(Z_MAX, Z4_MAX);
#endif
#endif
#elif !HAS_CUSTOM_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN
#elif !USES_Z_MIN_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN
// If this pin isn't the bed probe it's the Z endstop
UPDATE_ENDSTOP_BIT(Z, MAX);
#endif
@ -1021,7 +1021,7 @@ void Endstops::update() {
#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)
&& TERN1(USES_Z_MIN_PROBE_PIN, !z_probe_enabled)
) PROCESS_ENDSTOP_Z(MIN);
#if CORE_DIAG(XZ, X, MIN)
PROCESS_CORE_ENDSTOP(X,MIN,Z,MIN);
@ -1035,7 +1035,7 @@ void Endstops::update() {
#endif
// When closing the gap check the enabled probe
#if HAS_CUSTOM_PROBE_PIN
#if USES_Z_MIN_PROBE_PIN
if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE);
#endif
}
@ -1043,7 +1043,7 @@ void Endstops::update() {
#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
#elif !USES_Z_MIN_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN // No probe or probe is Z_MIN || Probe is not Z_MAX
PROCESS_ENDSTOP(Z, MAX);
#endif
#if CORE_DIAG(XZ, X, MIN)

View File

@ -69,7 +69,7 @@ enum EndstopEnum : char {
#endif
// Bed Probe state is distinct or shared with Z_MIN (i.e., when the probe is the only Z endstop)
_ES_ITEM(HAS_BED_PROBE, Z_MIN_PROBE IF_DISABLED(HAS_CUSTOM_PROBE_PIN, = Z_MIN))
_ES_ITEM(HAS_BED_PROBE, Z_MIN_PROBE IF_DISABLED(USES_Z_MIN_PROBE_PIN, = Z_MIN))
// The total number of states
NUM_ENDSTOP_STATES

View File

@ -38,7 +38,7 @@
};
#endif
#if HAS_CUSTOM_PROBE_PIN
#if USES_Z_MIN_PROBE_PIN
#define PROBE_TRIGGERED() (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING)
#else
#define PROBE_TRIGGERED() (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)

View File

@ -1134,7 +1134,7 @@
#define USE_ZMIN_PLUG
#endif
#undef _STOP_IN_USE
#if !HAS_CUSTOM_PROBE_PIN
#if !USES_Z_MIN_PROBE_PIN
#undef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN -1
#endif

View File

@ -117,7 +117,7 @@
//#define E3_MS2_PIN ?
//#define E3_MS3_PIN ?
#if HAS_CUSTOM_PROBE_PIN
#if USES_Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 49
#endif

View File

@ -105,7 +105,7 @@
#define E2_CS_PIN 61
#endif
#if HAS_CUSTOM_PROBE_PIN
#if USES_Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 49
#endif