From 4fd1de7fb7185728d357a155c86fafe438398e78 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Wed, 5 Jan 2022 06:14:40 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Define=20required=20endstop=20en?= =?UTF-8?q?ums=20(#23425)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/endstops.h | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index e1ee933e83..82a44cf95b 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -47,16 +47,26 @@ enum EndstopEnum : char { _ES_ITEM(HAS_K_MAX, K_MAX) // Extra Endstops for XYZ - _ES_ITEM(HAS_X2_MIN, X2_MIN) - _ES_ITEM(HAS_X2_MAX, X2_MAX) - _ES_ITEM(HAS_Y2_MIN, Y2_MIN) - _ES_ITEM(HAS_Y2_MAX, Y2_MAX) - _ES_ITEM(HAS_Z2_MIN, Z2_MIN) - _ES_ITEM(HAS_Z2_MAX, Z2_MAX) - _ES_ITEM(HAS_Z3_MIN, Z3_MIN) - _ES_ITEM(HAS_Z3_MAX, Z3_MAX) - _ES_ITEM(HAS_Z4_MIN, Z4_MIN) - _ES_ITEM(HAS_Z4_MAX, Z4_MAX) + #if ENABLED(X_DUAL_ENDSTOPS) + _ES_ITEM(HAS_X_MIN, X2_MIN) + _ES_ITEM(HAS_X_MAX, X2_MAX) + #endif + #if ENABLED(Y_DUAL_ENDSTOPS) + _ES_ITEM(HAS_Y_MIN, Y2_MIN) + _ES_ITEM(HAS_Y_MAX, Y2_MAX) + #endif + #if ENABLED(Z_MULTI_ENDSTOPS) + _ES_ITEM(HAS_Z_MIN, Z2_MIN) + _ES_ITEM(HAS_Z_MAX, Z2_MAX) + #if NUM_Z_STEPPER_DRIVERS >= 3 + _ES_ITEM(HAS_Z_MIN, Z3_MIN) + _ES_ITEM(HAS_Z_MAX, Z3_MAX) + #endif + #if NUM_Z_STEPPER_DRIVERS >= 4 + _ES_ITEM(HAS_Z_MIN, Z4_MIN) + _ES_ITEM(HAS_Z_MAX, Z4_MAX) + #endif + #endif // Bed Probe state is distinct or shared with Z_MIN (i.e., when the probe is the only Z endstop) #if !HAS_DELTA_SENSORLESS_PROBING