Add probe_switch_activated
This commit is contained in:
parent
9947072d2d
commit
10482ca49c
|
@ -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
|
||||
|
|
|
@ -116,6 +116,14 @@ class Endstops {
|
|||
;
|
||||
}
|
||||
|
||||
static inline bool probe_switch_activated() {
|
||||
return (true
|
||||
#if ENABLED(PROBE_ACTIVATION_SWITCH)
|
||||
&& READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Report endstop hits to serial. Called from loop().
|
||||
*/
|
||||
|
|
|
@ -519,7 +519,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) {
|
|||
*/
|
||||
bool Probe::tare() {
|
||||
#if BOTH(PROBE_ACTIVATION_SWITCH, PROBE_TARE_ONLY_WHILE_INACTIVE)
|
||||
if (READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE) {
|
||||
if (endstops.probe_switch_activated()) {
|
||||
SERIAL_ECHOLNPGM("Cannot tare an active probe");
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ opt_set SERIAL_PORT 1
|
|||
opt_set MOTHERBOARD BOARD_CREALITY_V452
|
||||
opt_disable NOZZLE_TO_PROBE_OFFSET
|
||||
opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
||||
opt_enable PROBE_ACTIVATION_SWITCH PROBE_ACTIVATION_SWITCH_PIN PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE
|
||||
opt_enable PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE
|
||||
exec_test $1 $2 "Creality V4.5.2 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3"
|
||||
|
||||
# clean up
|
||||
|
|
Loading…
Reference in a new issue