Add probe_switch_activated

This commit is contained in:
Scott Lahteine
2020-12-27 16:21:01 -06:00
parent d00c89946d
commit f423edd938
4 changed files with 13 additions and 8 deletions

View File

@@ -465,7 +465,7 @@ void _O2 Endstops::report_states() {
ES_REPORT(Z4_MAX);
#endif
#if BOTH(MARLIN_DEV_MODE, PROBE_ACTIVATION_SWITCH)
print_es_state(READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE, PSTR(STR_PROBE_EN));
print_es_state(probe_switch_activated(), PSTR(STR_PROBE_EN));
#endif
#if HAS_CUSTOM_PROBE_PIN
print_es_state(PROBE_TRIGGERED(), PSTR(STR_Z_PROBE));
@@ -618,11 +618,8 @@ void Endstops::update() {
#if HAS_BED_PROBE
// When closing the gap check the enabled probe
if (true
#if ENABLED(PROBE_ACTIVATION_SWITCH)
|| READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE
#endif
) UPDATE_ENDSTOP_BIT(Z, TERN(HAS_CUSTOM_PROBE_PIN, MIN_PROBE, MIN));
if (probe_switch_activated())
UPDATE_ENDSTOP_BIT(Z, TERN(HAS_CUSTOM_PROBE_PIN, MIN_PROBE, MIN));
#endif
#if HAS_Z_MAX && !Z_SPI_SENSORLESS