Skip to content

Commit ed7d269

Browse files
committed
Don't check Z_MAX on raise when the probe pwns the pin
1 parent 0d9efb2 commit ed7d269

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Marlin/endstops.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void Endstops::update() {
315315
#else
316316
if (stepper.motor_direction(Z_AXIS))
317317
#endif
318-
{ // z -direction
318+
{ // Z -direction. Gantry down, bed up.
319319
#if HAS_Z_MIN
320320

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

342342
#endif // HAS_Z_MIN
343343

344+
// When closing the gap check the enabled probe
344345
#if ENABLED(Z_MIN_PROBE_ENDSTOP)
345346
if (z_probe_enabled) {
346347
UPDATE_ENDSTOP(Z, MIN_PROBE);
347348
if (TEST_ENDSTOP(Z_MIN_PROBE)) SBI(endstop_hit_bits, Z_MIN_PROBE);
348349
}
349350
#endif
350351
}
351-
else { // z +direction
352+
else { // Z +direction. Gantry up, bed down.
352353
#if HAS_Z_MAX
353354

355+
// Check both Z dual endstops
354356
#if ENABLED(Z_DUAL_ENDSTOPS)
355357

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

363365
test_dual_z_endstops(Z_MAX, Z2_MAX);
364366

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

367371
UPDATE_ENDSTOP(Z, MAX);
368372

369-
#endif // !Z_DUAL_ENDSTOPS
373+
#endif // !Z_MIN_PROBE_PIN...
370374
#endif // Z_MAX_PIN
371375
}
372376
#if ENABLED(COREXZ)

0 commit comments

Comments
 (0)