|
@@ -32,12 +32,15 @@
|
32
|
32
|
#define _ES_ITEM(K,N) TERN_(K,DEFER4(__ES_ITEM)(N))
|
33
|
33
|
|
34
|
34
|
enum EndstopEnum : char {
|
|
35
|
+ // Common XYZ (ABC) endstops. Defined according to USE_[XYZ](MIN|MAX)_PLUG settings.
|
35
|
36
|
_ES_ITEM(HAS_X_MIN, X_MIN)
|
36
|
37
|
_ES_ITEM(HAS_X_MAX, X_MAX)
|
37
|
38
|
_ES_ITEM(HAS_Y_MIN, Y_MIN)
|
38
|
39
|
_ES_ITEM(HAS_Y_MAX, Y_MAX)
|
39
|
40
|
_ES_ITEM(HAS_Z_MIN, Z_MIN)
|
40
|
41
|
_ES_ITEM(HAS_Z_MAX, Z_MAX)
|
|
42
|
+
|
|
43
|
+ // Extra Endstops for XYZ
|
41
|
44
|
#if ENABLED(X_DUAL_ENDSTOPS)
|
42
|
45
|
_ES_ITEM(HAS_X_MIN, X2_MIN)
|
43
|
46
|
_ES_ITEM(HAS_X_MAX, X2_MAX)
|
|
@@ -58,13 +61,24 @@ enum EndstopEnum : char {
|
58
|
61
|
_ES_ITEM(HAS_Z_MAX, Z4_MAX)
|
59
|
62
|
#endif
|
60
|
63
|
#endif
|
61
|
|
- _ES_ITEM(HAS_Z_MIN_PROBE_PIN, Z_MIN_PROBE)
|
|
64
|
+
|
|
65
|
+ // Bed Probe state is distinct or shared with Z_MIN (i.e., when the probe is the only Z endstop)
|
|
66
|
+ _ES_ITEM(HAS_BED_PROBE, Z_MIN_PROBE IF_DISABLED(HAS_CUSTOM_PROBE_PIN, = Z_MIN))
|
|
67
|
+
|
|
68
|
+ // The total number of states
|
62
|
69
|
NUM_ENDSTOP_STATES
|
63
|
|
-};
|
64
|
70
|
|
65
|
|
-#define X_ENDSTOP TERN(X_HOME_TO_MAX, X_MAX, X_MIN)
|
66
|
|
-#define Y_ENDSTOP TERN(Y_HOME_TO_MAX, Y_MAX, Y_MIN)
|
67
|
|
-#define Z_ENDSTOP TERN(Z_HOME_TO_MAX, Z_MAX, TERN(HOMING_Z_WITH_PROBE, Z_MIN_PROBE, Z_MIN))
|
|
71
|
+ // Endstops can be either MIN or MAX but not both
|
|
72
|
+ #if HAS_X_MIN || HAS_X_MAX
|
|
73
|
+ , X_ENDSTOP = TERN(X_HOME_TO_MAX, X_MAX, X_MIN)
|
|
74
|
+ #endif
|
|
75
|
+ #if HAS_Y_MIN || HAS_Y_MAX
|
|
76
|
+ , Y_ENDSTOP = TERN(Y_HOME_TO_MAX, Y_MAX, Y_MIN)
|
|
77
|
+ #endif
|
|
78
|
+ #if HAS_Z_MIN || HAS_Z_MAX
|
|
79
|
+ , Z_ENDSTOP = TERN(Z_HOME_TO_MAX, Z_MAX, TERN(HOMING_Z_WITH_PROBE, Z_MIN_PROBE, Z_MIN))
|
|
80
|
+ #endif
|
|
81
|
+};
|
68
|
82
|
|
69
|
83
|
#undef __ES_ITEM
|
70
|
84
|
#undef _ES_ITEM
|