|
@@ -59,30 +59,49 @@
|
59
|
59
|
#endif
|
60
|
60
|
}
|
61
|
61
|
|
62
|
|
-#elif ENABLED(Z_DUAL_ENDSTOPS) // !DELTA && ENABLED(Z_DUAL_ENDSTOPS)
|
|
62
|
+#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
|
63
|
63
|
|
64
|
64
|
#include "../../module/endstops.h"
|
65
|
65
|
|
66
|
66
|
/**
|
67
|
|
- * M666: For a Dual Endstop setup, set offsets for any 2nd endstops.
|
|
67
|
+ * M666: Set Dual Endstops offsets for X, Y, and/or Z.
|
|
68
|
+ * With no parameters report current offsets.
|
68
|
69
|
*/
|
69
|
|
- void GcodeSuite::M666() {
|
70
|
|
- SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): ");
|
|
70
|
+ inline void gcode_M666() {
|
|
71
|
+ bool report = true;
|
71
|
72
|
#if ENABLED(X_DUAL_ENDSTOPS)
|
72
|
|
- if (parser.seen('X')) endstops.x_endstop_adj = parser.value_linear_units();
|
73
|
|
- SERIAL_ECHOPAIR(" X", endstops.x_endstop_adj);
|
|
73
|
+ if (parser.seen('X')) {
|
|
74
|
+ endstops.x_endstop_adj = parser.value_linear_units();
|
|
75
|
+ report = false;
|
|
76
|
+ }
|
74
|
77
|
#endif
|
75
|
78
|
#if ENABLED(Y_DUAL_ENDSTOPS)
|
76
|
|
- if (parser.seen('Y')) endstops.y_endstop_adj = parser.value_linear_units();
|
77
|
|
- SERIAL_ECHOPAIR(" Y", endstops.y_endstop_adj);
|
|
79
|
+ if (parser.seen('Y')) {
|
|
80
|
+ endstops.y_endstop_adj = parser.value_linear_units();
|
|
81
|
+ report = false;
|
|
82
|
+ }
|
78
|
83
|
#endif
|
79
|
84
|
#if ENABLED(Z_DUAL_ENDSTOPS)
|
80
|
|
- if (parser.seen('Z')) endstops.z_endstop_adj = parser.value_linear_units();
|
81
|
|
- SERIAL_ECHOPAIR(" Z", endstops.z_endstop_adj);
|
|
85
|
+ if (parser.seen('Z')) {
|
|
86
|
+ endstops.z_endstop_adj = parser.value_linear_units();
|
|
87
|
+ report = false;
|
|
88
|
+ }
|
82
|
89
|
#endif
|
83
|
|
- SERIAL_EOL();
|
|
90
|
+ if (report) {
|
|
91
|
+ SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): ");
|
|
92
|
+ #if ENABLED(X_DUAL_ENDSTOPS)
|
|
93
|
+ SERIAL_ECHOPAIR(" X", endstops.x_endstop_adj);
|
|
94
|
+ #endif
|
|
95
|
+ #if ENABLED(Y_DUAL_ENDSTOPS)
|
|
96
|
+ SERIAL_ECHOPAIR(" Y", endstops.y_endstop_adj);
|
|
97
|
+ #endif
|
|
98
|
+ #if ENABLED(Z_DUAL_ENDSTOPS)
|
|
99
|
+ SERIAL_ECHOPAIR(" Z", endstops.z_endstop_adj);
|
|
100
|
+ #endif
|
|
101
|
+ SERIAL_EOL();
|
|
102
|
+ }
|
84
|
103
|
}
|
85
|
104
|
|
86
|
|
-#endif
|
|
105
|
+#endif // X_DUAL_ENDSTOPS || Y_DUAL_ENDSTOPS || Z_DUAL_ENDSTOPS
|
87
|
106
|
|
88
|
107
|
#endif // DELTA || Z_DUAL_ENDSTOPS
|