Skip to content

Commit

Permalink
Don't check Z_MAX on raise when the probe pwns the pin
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Sep 30, 2016
1 parent 0d9efb2 commit ed7d269
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Marlin/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ void Endstops::update() {
#else
if (stepper.motor_direction(Z_AXIS))
#endif
{ // z -direction
{ // Z -direction. Gantry down, bed up.
#if HAS_Z_MIN

#if ENABLED(Z_DUAL_ENDSTOPS)
Expand All @@ -341,16 +341,18 @@ void Endstops::update() {

#endif // HAS_Z_MIN

// When closing the gap check the enabled probe
#if ENABLED(Z_MIN_PROBE_ENDSTOP)
if (z_probe_enabled) {
UPDATE_ENDSTOP(Z, MIN_PROBE);
if (TEST_ENDSTOP(Z_MIN_PROBE)) SBI(endstop_hit_bits, Z_MIN_PROBE);
}
#endif
}
else { // z +direction
else { // Z +direction. Gantry up, bed down.
#if HAS_Z_MAX

// Check both Z dual endstops
#if ENABLED(Z_DUAL_ENDSTOPS)

UPDATE_ENDSTOP_BIT(Z, MAX);
Expand All @@ -362,11 +364,13 @@ void Endstops::update() {

test_dual_z_endstops(Z_MAX, Z2_MAX);

#else // !Z_DUAL_ENDSTOPS
// If this pin is not hijacked for the bed probe
// then it belongs to the Z endstop
#elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN

UPDATE_ENDSTOP(Z, MAX);

#endif // !Z_DUAL_ENDSTOPS
#endif // !Z_MIN_PROBE_PIN...
#endif // Z_MAX_PIN
}
#if ENABLED(COREXZ)
Expand Down

0 comments on commit ed7d269

Please sign in to comment.