|
|
@ -243,7 +243,7 @@ void Endstops::init() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if USES_Z_MIN_PROBE_ENDSTOP
|
|
|
|
#if HAS_CUSTOM_PROBE_PIN
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE)
|
|
|
|
SET_INPUT_PULLUP(Z_MIN_PROBE_PIN);
|
|
|
|
SET_INPUT_PULLUP(Z_MIN_PROBE_PIN);
|
|
|
|
#elif ENABLED(ENDSTOPPULLDOWN_ZMIN_PROBE)
|
|
|
|
#elif ENABLED(ENDSTOPPULLDOWN_ZMIN_PROBE)
|
|
|
@ -366,7 +366,7 @@ void Endstops::event_handler() {
|
|
|
|
ENDSTOP_HIT_TEST_Y();
|
|
|
|
ENDSTOP_HIT_TEST_Y();
|
|
|
|
ENDSTOP_HIT_TEST_Z();
|
|
|
|
ENDSTOP_HIT_TEST_Z();
|
|
|
|
|
|
|
|
|
|
|
|
#if USES_Z_MIN_PROBE_ENDSTOP
|
|
|
|
#if HAS_CUSTOM_PROBE_PIN
|
|
|
|
#define P_AXIS Z_AXIS
|
|
|
|
#define P_AXIS Z_AXIS
|
|
|
|
if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P');
|
|
|
|
if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P');
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -443,7 +443,7 @@ void _O2 Endstops::M119() {
|
|
|
|
#if HAS_Z3_MAX
|
|
|
|
#if HAS_Z3_MAX
|
|
|
|
ES_REPORT(Z3_MAX);
|
|
|
|
ES_REPORT(Z3_MAX);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if USES_Z_MIN_PROBE_ENDSTOP
|
|
|
|
#if HAS_CUSTOM_PROBE_PIN
|
|
|
|
print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(MSG_Z_PROBE));
|
|
|
|
print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(MSG_Z_PROBE));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if HAS_FILAMENT_SENSOR
|
|
|
|
#if HAS_FILAMENT_SENSOR
|
|
|
@ -538,60 +538,52 @@ void Endstops::update() {
|
|
|
|
* Check and update endstops
|
|
|
|
* Check and update endstops
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#if HAS_X_MIN && !X_SPI_SENSORLESS
|
|
|
|
#if HAS_X_MIN && !X_SPI_SENSORLESS
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(X, MIN);
|
|
|
|
#if ENABLED(X_DUAL_ENDSTOPS)
|
|
|
|
#if ENABLED(X_DUAL_ENDSTOPS)
|
|
|
|
UPDATE_ENDSTOP_BIT(X, MIN);
|
|
|
|
|
|
|
|
#if HAS_X2_MIN
|
|
|
|
#if HAS_X2_MIN
|
|
|
|
UPDATE_ENDSTOP_BIT(X2, MIN);
|
|
|
|
UPDATE_ENDSTOP_BIT(X2, MIN);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
COPY_LIVE_STATE(X_MIN, X2_MIN);
|
|
|
|
COPY_LIVE_STATE(X_MIN, X2_MIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(X, MIN);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_X_MAX && !X_SPI_SENSORLESS
|
|
|
|
#if HAS_X_MAX && !X_SPI_SENSORLESS
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(X, MAX);
|
|
|
|
#if ENABLED(X_DUAL_ENDSTOPS)
|
|
|
|
#if ENABLED(X_DUAL_ENDSTOPS)
|
|
|
|
UPDATE_ENDSTOP_BIT(X, MAX);
|
|
|
|
|
|
|
|
#if HAS_X2_MAX
|
|
|
|
#if HAS_X2_MAX
|
|
|
|
UPDATE_ENDSTOP_BIT(X2, MAX);
|
|
|
|
UPDATE_ENDSTOP_BIT(X2, MAX);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
COPY_LIVE_STATE(X_MAX, X2_MAX);
|
|
|
|
COPY_LIVE_STATE(X_MAX, X2_MAX);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(X, MAX);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Y_MIN && !Y_SPI_SENSORLESS
|
|
|
|
#if HAS_Y_MIN && !Y_SPI_SENSORLESS
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(Y, MIN);
|
|
|
|
#if ENABLED(Y_DUAL_ENDSTOPS)
|
|
|
|
#if ENABLED(Y_DUAL_ENDSTOPS)
|
|
|
|
UPDATE_ENDSTOP_BIT(Y, MIN);
|
|
|
|
|
|
|
|
#if HAS_Y2_MIN
|
|
|
|
#if HAS_Y2_MIN
|
|
|
|
UPDATE_ENDSTOP_BIT(Y2, MIN);
|
|
|
|
UPDATE_ENDSTOP_BIT(Y2, MIN);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
COPY_LIVE_STATE(Y_MIN, Y2_MIN);
|
|
|
|
COPY_LIVE_STATE(Y_MIN, Y2_MIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(Y, MIN);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Y_MAX && !Y_SPI_SENSORLESS
|
|
|
|
#if HAS_Y_MAX && !Y_SPI_SENSORLESS
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(Y, MAX);
|
|
|
|
#if ENABLED(Y_DUAL_ENDSTOPS)
|
|
|
|
#if ENABLED(Y_DUAL_ENDSTOPS)
|
|
|
|
UPDATE_ENDSTOP_BIT(Y, MAX);
|
|
|
|
|
|
|
|
#if HAS_Y2_MAX
|
|
|
|
#if HAS_Y2_MAX
|
|
|
|
UPDATE_ENDSTOP_BIT(Y2, MAX);
|
|
|
|
UPDATE_ENDSTOP_BIT(Y2, MAX);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
COPY_LIVE_STATE(Y_MAX, Y2_MAX);
|
|
|
|
COPY_LIVE_STATE(Y_MAX, Y2_MAX);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(Y, MAX);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Z_MIN && !Z_SPI_SENSORLESS
|
|
|
|
#if HAS_Z_MIN && !Z_SPI_SENSORLESS
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(Z, MIN);
|
|
|
|
#if Z_MULTI_ENDSTOPS
|
|
|
|
#if Z_MULTI_ENDSTOPS
|
|
|
|
UPDATE_ENDSTOP_BIT(Z, MIN);
|
|
|
|
|
|
|
|
#if HAS_Z2_MIN
|
|
|
|
#if HAS_Z2_MIN
|
|
|
|
UPDATE_ENDSTOP_BIT(Z2, MIN);
|
|
|
|
UPDATE_ENDSTOP_BIT(Z2, MIN);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
@ -604,15 +596,11 @@ void Endstops::update() {
|
|
|
|
COPY_LIVE_STATE(Z_MIN, Z3_MIN);
|
|
|
|
COPY_LIVE_STATE(Z_MIN, Z3_MIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(Z, MIN);
|
|
|
|
|
|
|
|
#elif Z_HOME_DIR < 0
|
|
|
|
|
|
|
|
UPDATE_ENDSTOP_BIT(Z, MIN);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// When closing the gap check the enabled probe
|
|
|
|
// When closing the gap check the enabled probe
|
|
|
|
#if USES_Z_MIN_PROBE_ENDSTOP
|
|
|
|
#if HAS_CUSTOM_PROBE_PIN
|
|
|
|
UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
|
|
|
|
UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -632,7 +620,7 @@ void Endstops::update() {
|
|
|
|
COPY_LIVE_STATE(Z_MAX, Z3_MAX);
|
|
|
|
COPY_LIVE_STATE(Z_MAX, Z3_MAX);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#elif !USES_Z_MIN_PROBE_ENDSTOP || Z_MAX_PIN != Z_MIN_PROBE_PIN
|
|
|
|
#elif !HAS_CUSTOM_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN
|
|
|
|
// If this pin isn't the bed probe it's the Z endstop
|
|
|
|
// If this pin isn't the bed probe it's the Z endstop
|
|
|
|
UPDATE_ENDSTOP_BIT(Z, MAX);
|
|
|
|
UPDATE_ENDSTOP_BIT(Z, MAX);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -765,7 +753,7 @@ void Endstops::update() {
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
|
|
|
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
|
|
|
if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN);
|
|
|
|
if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN);
|
|
|
|
#elif USES_Z_MIN_PROBE_ENDSTOP
|
|
|
|
#elif HAS_CUSTOM_PROBE_PIN
|
|
|
|
if (!z_probe_enabled) PROCESS_ENDSTOP(Z, MIN);
|
|
|
|
if (!z_probe_enabled) PROCESS_ENDSTOP(Z, MIN);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
PROCESS_ENDSTOP(Z, MIN);
|
|
|
|
PROCESS_ENDSTOP(Z, MIN);
|
|
|
@ -774,7 +762,7 @@ void Endstops::update() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// When closing the gap check the enabled probe
|
|
|
|
// When closing the gap check the enabled probe
|
|
|
|
#if USES_Z_MIN_PROBE_ENDSTOP
|
|
|
|
#if HAS_CUSTOM_PROBE_PIN
|
|
|
|
if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE);
|
|
|
|
if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -784,7 +772,7 @@ void Endstops::update() {
|
|
|
|
PROCESS_TRIPLE_ENDSTOP(Z, Z2, Z3, MAX);
|
|
|
|
PROCESS_TRIPLE_ENDSTOP(Z, Z2, Z3, MAX);
|
|
|
|
#elif ENABLED(Z_DUAL_ENDSTOPS)
|
|
|
|
#elif ENABLED(Z_DUAL_ENDSTOPS)
|
|
|
|
PROCESS_DUAL_ENDSTOP(Z, Z2, MAX);
|
|
|
|
PROCESS_DUAL_ENDSTOP(Z, Z2, MAX);
|
|
|
|
#elif !USES_Z_MIN_PROBE_ENDSTOP || Z_MAX_PIN != Z_MIN_PROBE_PIN
|
|
|
|
#elif !HAS_CUSTOM_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN
|
|
|
|
// If this pin is not hijacked for the bed probe
|
|
|
|
// If this pin is not hijacked for the bed probe
|
|
|
|
// then it belongs to the Z endstop
|
|
|
|
// then it belongs to the Z endstop
|
|
|
|
PROCESS_ENDSTOP(Z, MAX);
|
|
|
|
PROCESS_ENDSTOP(Z, MAX);
|
|
|
|