From 043b917c9e3c93f93eded822d15cf02e37e6f651 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 18 Apr 2023 21:19:06 -0500 Subject: [PATCH] just use _ENDSTOP_HIT(Z, ENDSTOP) --- Marlin/src/module/endstops.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index b4193aa83f0e5..74fa897eb7ced 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -922,15 +922,18 @@ void Endstops::update() { #if HAS_Y_AXIS const bool ymoving = stepper.axis_is_moving(Y_AXIS); #endif - #if HAS_Z_MIN + #if HAS_Z_AXIS const bool zmoving = stepper.axis_is_moving(Z_AXIS); #endif - 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)); + #if HAS_X_AXIS + if (xmoving) { _ENDSTOP_HIT(X, ENDSTOP); planner.endstop_triggered(X_AXIS); } + #endif + #if HAS_Y_AXIS + if (ymoving) { _ENDSTOP_HIT(Y, ENDSTOP); planner.endstop_triggered(Y_AXIS); } + #endif + #if HAS_Z_AXIS + if (zmoving) { _ENDSTOP_HIT(Z, ENDSTOP); planner.endstop_triggered(Z_AXIS); } + #endif } #endif