Skip to content

Commit

Permalink
Update endstops_trigsteps for all moving axes
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 19, 2023
1 parent 0ffdd58 commit ae829df
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Marlin/src/module/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,14 +915,22 @@ void Endstops::update() {
#if HAS_G38_PROBE // TODO (DerAndere): Add support for HAS_I_AXIS
// 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 (stepper.axis_is_moving(X_AXIS)) { _ENDSTOP_HIT(X, TERN(X_HOME_TO_MIN, MIN, MAX)); planner.endstop_triggered(X_AXIS); }
G38_did_trigger = true;
#if HAS_X_AXIS
const bool xmoving = TERN0(HAS_X_AXIS, stepper.axis_is_moving(X_AXIS));
#endif
#if HAS_Y_AXIS
else if (stepper.axis_is_moving(Y_AXIS)) { _ENDSTOP_HIT(Y, TERN(Y_HOME_TO_MIN, MIN, MAX)); planner.endstop_triggered(Y_AXIS); }
const bool ymoving = TERN0(HAS_Y_AXIS, stepper.axis_is_moving(Y_AXIS));
#endif
#if HAS_Z_MIN
else if (stepper.axis_is_moving(Z_AXIS)) { _ENDSTOP_HIT(Z, TERN(Z_HOME_TO_MIN, MIN, MAX)); planner.endstop_triggered(Z_AXIS); }
#if HAS_Z_AXIS
const bool zmoving = TERN0(HAS_Z_AXIS, stepper.axis_is_moving(Z_AXIS));
#endif
G38_did_trigger = true;
TERN_(HAS_X_AXIS, if (xmoving) _ENDSTOP_HIT(X, TERN(X_HOME_TO_MIN, MIN, MAX)));
TERN_(HAS_Y_AXIS, if (ymoving) _ENDSTOP_HIT(Y, TERN(Y_HOME_TO_MIN, MIN, MAX)));
TERN_(HAS_Z_MIN, if (zmoving) _ENDSTOP_HIT(Z, TERN(Z_HOME_TO_MIN, MIN, MAX)));
TERN_(HAS_X_AXIS, if (xmoving) planner.endstop_triggered(X_AXIS));
TERN_(HAS_Y_AXIS, if (ymoving) planner.endstop_triggered(Y_AXIS));
TERN_(HAS_Z_MIN, if (zmoving) planner.endstop_triggered(Z_AXIS));
}
#endif

Expand Down

0 comments on commit ae829df

Please sign in to comment.