|
@@ -71,29 +71,27 @@
|
71
|
71
|
#endif
|
72
|
72
|
#if ENABLED(Z_MULTI_ENDSTOPS)
|
73
|
73
|
if (parser.seenval('Z')) {
|
74
|
|
- #if NUM_Z_STEPPER_DRIVERS >= 3
|
75
|
|
- const float z_adj = parser.value_linear_units();
|
76
|
|
- const int ind = parser.intval('S');
|
77
|
|
- if (!ind || ind == 2) endstops.z2_endstop_adj = z_adj;
|
78
|
|
- if (!ind || ind == 3) endstops.z3_endstop_adj = z_adj;
|
79
|
|
- #if NUM_Z_STEPPER_DRIVERS >= 4
|
80
|
|
- if (!ind || ind == 4) endstops.z4_endstop_adj = z_adj;
|
81
|
|
- #endif
|
|
74
|
+ const float z_adj = parser.value_linear_units();
|
|
75
|
+ #if NUM_Z_STEPPER_DRIVERS == 2
|
|
76
|
+ endstops.z2_endstop_adj = z_adj;
|
82
|
77
|
#else
|
83
|
|
- endstops.z2_endstop_adj = parser.value_linear_units();
|
|
78
|
+ const int ind = parser.intval('S');
|
|
79
|
+ #define _SET_ZADJ(N) if (!ind || ind == N) endstops.z##N##_endstop_adj = z_adj;
|
|
80
|
+ REPEAT_S(2, INCREMENT(NUM_Z_STEPPER_DRIVERS), _SET_ZADJ)
|
84
|
81
|
#endif
|
85
|
82
|
}
|
86
|
83
|
#endif
|
87
|
84
|
if (!parser.seen("XYZ")) {
|
|
85
|
+ auto echo_adj = [](PGM_P const label, const_float_t value) { SERIAL_ECHOPAIR_P(label, value); };
|
88
|
86
|
SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): ");
|
89
|
87
|
#if ENABLED(X_DUAL_ENDSTOPS)
|
90
|
|
- SERIAL_ECHOPAIR(" X2:", endstops.x2_endstop_adj);
|
|
88
|
+ echo_adj(PSTR(" X2:"), endstops.x2_endstop_adj);
|
91
|
89
|
#endif
|
92
|
90
|
#if ENABLED(Y_DUAL_ENDSTOPS)
|
93
|
|
- SERIAL_ECHOPAIR(" Y2:", endstops.y2_endstop_adj);
|
|
91
|
+ echo_adj(PSTR(" Y2:"), endstops.y2_endstop_adj);
|
94
|
92
|
#endif
|
95
|
93
|
#if ENABLED(Z_MULTI_ENDSTOPS)
|
96
|
|
- #define _ECHO_ZADJ(N) SERIAL_ECHOPAIR(" Z" STRINGIFY(N) ":", endstops.z##N##_endstop_adj);
|
|
94
|
+ #define _ECHO_ZADJ(N) echo_adj(PSTR(" Z" STRINGIFY(N) ":"), endstops.z##N##_endstop_adj);
|
97
|
95
|
REPEAT_S(2, INCREMENT(NUM_Z_STEPPER_DRIVERS), _ECHO_ZADJ)
|
98
|
96
|
#endif
|
99
|
97
|
SERIAL_EOL();
|