Skip to content

Commit

Permalink
Use Z_MIN_PROBE convenience enum
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 19, 2023
1 parent 62641bb commit 39471a5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Marlin/src/module/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ void Endstops::update() {

#if ENABLED(G38_PROBE_TARGET)
// For G38 moves check the probe's pin for ALL movement
if (G38_move) UPDATE_ENDSTOP_BIT(Z, TERN(USES_Z_MIN_PROBE_PIN, MIN_PROBE, MIN));
if (G38_move) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
#endif

// With Dual X, endstops are only checked in the homing direction for the active extruder
Expand Down Expand Up @@ -624,8 +624,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(USES_Z_MIN_PROBE_PIN, MIN_PROBE, MIN));
if (probe_switch_activated()) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
#endif

#if HAS_Z_MAX && !Z_SPI_SENSORLESS
Expand Down Expand Up @@ -913,7 +912,7 @@ void Endstops::update() {

#if ENABLED(G38_PROBE_TARGET)
// For G38 moves check the probe's pin for ALL movement
if (G38_move && TEST_ENDSTOP(_ENDSTOP(Z, TERN(USES_Z_MIN_PROBE_PIN, MIN_PROBE, MIN))) == TERN1(G38_PROBE_AWAY, (G38_move < 4))) {
if (G38_move && TEST_ENDSTOP(Z_MIN_PROBE) == TERN1(G38_PROBE_AWAY, (G38_move < 4))) {
G38_did_trigger = true;
#define _G38_SET(Q) | (stepper.axis_is_moving(_AXIS(Q)) << _AXIS(Q))
#define _G38_RESP(Q) if (moving[_AXIS(Q)]) { _ENDSTOP_HIT(Q, ENDSTOP); planner.endstop_triggered(_AXIS(Q)); }
Expand Down

0 comments on commit 39471a5

Please sign in to comment.