@@ -39,23 +39,29 @@ static void config_prefix(PGM_P const name, PGM_P const pref=nullptr, const int8
39
39
if (ind >= 0 ) { SERIAL_ECHO (ind); SERIAL_CHAR (' :' ); }
40
40
SERIAL_ECHOPGM_P (name, C (' :' ));
41
41
}
42
- static void config_line (PGM_P const name, const float val, PGM_P const pref=nullptr , const int8_t ind=-1 ) {
42
+ template <typename T>
43
+ static void config_line (PGM_P const name, const T val, PGM_P const pref=nullptr , const int8_t ind=-1 ) {
43
44
config_prefix (name, pref, ind);
44
45
SERIAL_ECHOLN (val);
45
46
}
46
- static void config_line (FSTR_P const name, const float val, FSTR_P const pref=nullptr , const int8_t ind=-1 ) {
47
+ template <typename T>
48
+ static void config_line (FSTR_P const name, const T val, FSTR_P const pref=nullptr , const int8_t ind=-1 ) {
47
49
config_line (FTOP (name), val, FTOP (pref), ind);
48
50
}
49
- static void config_line (PGM_P const name, const float val, FSTR_P const pref=nullptr , const int8_t ind=-1 ) {
51
+ template <typename T>
52
+ static void config_line (PGM_P const name, const T val, FSTR_P const pref=nullptr , const int8_t ind=-1 ) {
50
53
config_line (name, val, FTOP (pref), ind);
51
54
}
52
- static void config_line (FSTR_P const name, const float val, PGM_P const pref=nullptr , const int8_t ind=-1 ) {
55
+ template <typename T>
56
+ static void config_line (FSTR_P const name, const T val, PGM_P const pref=nullptr , const int8_t ind=-1 ) {
53
57
config_line (FTOP (name), val, pref, ind);
54
58
}
55
- static void config_line_e (const int8_t e, PGM_P const name, const float val) {
59
+ template <typename T>
60
+ static void config_line_e (const int8_t e, PGM_P const name, const T val) {
56
61
config_line (name, val, PSTR (" Extr." ), e + 1 );
57
62
}
58
- static void config_line_e (const int8_t e, FSTR_P const name, const float val) {
63
+ template <typename T>
64
+ static void config_line_e (const int8_t e, FSTR_P const name, const T val) {
59
65
config_line_e (e, FTOP (name), val);
60
66
}
61
67
@@ -64,10 +70,6 @@ static void config_line_e(const int8_t e, FSTR_P const name, const float val) {
64
70
* in RepRapFirmware-compatible format
65
71
*/
66
72
void GcodeSuite::M360 () {
67
- #if ANY(CLASSIC_JERK, HAS_LINEAR_E_JERK)
68
- PGMSTR (JERK_STR, " Jerk" );
69
- #endif
70
-
71
73
//
72
74
// Basics and Enabled items
73
75
//
@@ -88,9 +90,8 @@ void GcodeSuite::M360() {
88
90
//
89
91
// Axis letters, in PROGMEM
90
92
//
91
- PGMSTR (X_STR, " X" ); PGMSTR (Y_STR, " Y" ); PGMSTR (Z_STR, " Z" );
92
- PGMSTR (I_STR, STR_I); PGMSTR (J_STR, STR_J); PGMSTR (K_STR, STR_K);
93
- PGMSTR (U_STR, STR_U); PGMSTR (V_STR, STR_V); PGMSTR (W_STR, STR_W);
93
+ #define _DEFINE_A_STR (Q ) PGMSTR(Q##_STR, STR_##Q);
94
+ MAIN_AXIS_MAP (_DEFINE_A_STR);
94
95
95
96
//
96
97
// Homing Directions
@@ -124,17 +125,23 @@ void GcodeSuite::M360() {
124
125
config_line (H_DIR_STR, W_HOME_DIR, W_STR);
125
126
#endif
126
127
128
+ #if ANY(CLASSIC_JERK, HAS_LINEAR_E_JERK)
129
+ PGMSTR (JERK_STR, " Jerk" );
130
+ #endif
131
+
127
132
//
128
133
// XYZ Axis Jerk
129
134
//
130
135
#if ENABLED(CLASSIC_JERK)
131
- if (planner.max_jerk .x == planner.max_jerk .y )
136
+ #define _REPORT_JERK (Q ), config_line(Q##_STR, planner.max_jerk.Q, JERK_STR);
137
+ if (TERN0 (HAS_Y_AXIS, planner.max_jerk .x == planner.max_jerk .y ))
132
138
config_line (F (" XY" ), planner.max_jerk .x , JERK_STR);
133
139
else {
134
- config_line (X_STR, planner. max_jerk . x , JERK_STR );
135
- config_line (Y_STR, planner. max_jerk . y , JERK_STR );
140
+ TERN_ (HAS_X_AXIS, _REPORT_JERK (X) );
141
+ TERN_ (HAS_Y_AXIS, _REPORT_JERK (Y) );
136
142
}
137
- config_line (Z_STR, planner.max_jerk .z , JERK_STR);
143
+ TERN_ (HAS_Z_AXIS, config_line (Z_STR, planner.max_jerk .z , JERK_STR));
144
+ SECONDARY_AXIS_MAP (_REPORT_JERK);
138
145
#endif
139
146
140
147
//
@@ -168,36 +175,36 @@ void GcodeSuite::M360() {
168
175
const xyz_pos_t wmin = cmin.asLogical (), wmax = cmax.asLogical ();
169
176
170
177
PGMSTR (MIN_STR, " Min" );
171
- #define _REPORT_MIN (Q ) config_line(MIN_STR, wmin.Q, Q##_STR)
172
- LOGICAL_AXIS_MAP (_REPORT_MIN);
178
+ #define _REPORT_MIN (Q ) config_line(MIN_STR, wmin.Q, Q##_STR);
179
+ MAIN_AXIS_MAP (_REPORT_MIN);
173
180
174
181
PGMSTR (MAX_STR, " Max" );
175
- #define _REPORT_MAX (Q ) config_line(MAX_STR, wmax.Q, Q##_STR)
176
- LOGICAL_AXIS_MAP (_REPORT_MAX);
182
+ #define _REPORT_MAX (Q ) config_line(MAX_STR, wmax.Q, Q##_STR);
183
+ MAIN_AXIS_MAP (_REPORT_MAX);
177
184
178
185
PGMSTR (SIZE_STR, " Size" );
179
- #define _REPORT_SIZE (Q ) config_line(SIZE_STR, wmax.Q - wmin.Q, Q##_STR)
180
- LOGICAL_AXIS_MAP (_REPORT_SIZE);
186
+ #define _REPORT_SIZE (Q ) config_line(SIZE_STR, wmax.Q - wmin.Q, Q##_STR);
187
+ MAIN_AXIS_MAP (_REPORT_SIZE);
181
188
182
189
//
183
190
// Axis Steps per mm
184
191
//
185
192
PGMSTR (S_MM_STR, " Steps/mm" );
186
- #define _REPORT_S_MM (A ) config_line(S_MM_STR, planner.settings.axis_steps_per_mm[_AXIS(A )], A ##_STR);
187
- LOGICAL_AXIS_MAP (_REPORT_S_MM);
193
+ #define _REPORT_S_MM (Q ) config_line(S_MM_STR, planner.settings.axis_steps_per_mm[_AXIS(Q )], Q ##_STR);
194
+ MAIN_AXIS_MAP (_REPORT_S_MM);
188
195
189
196
//
190
197
// Print and Travel Acceleration
191
198
//
192
- #define _ACCEL (A ,B ) _MIN(planner.settings.max_acceleration_mm_per_s2[A ##_AXIS], planner.settings.B)
199
+ #define _ACCEL (Q ,B ) _MIN(planner.settings.max_acceleration_mm_per_s2[Q ##_AXIS], planner.settings.B)
193
200
194
201
PGMSTR (P_ACC_STR, " PrintAccel" );
195
- #define _REPORT_P_ACC (A ) config_line(P_ACC_STR, _ACCEL(A , acceleration), A ##_STR);
196
- LOGICAL_AXIS_MAP (_REPORT_P_ACC);
202
+ #define _REPORT_P_ACC (Q ) config_line(P_ACC_STR, _ACCEL(Q , acceleration), Q ##_STR);
203
+ MAIN_AXIS_MAP (_REPORT_P_ACC);
197
204
198
205
PGMSTR (T_ACC_STR, " TravelAccel" );
199
- #define _REPORT_T_ACC (A ) config_line(T_ACC_STR, _ACCEL(A , travel_acceleration), A ##_STR);
200
- LOGICAL_AXIS_MAP (_REPORT_T_ACC);
206
+ #define _REPORT_T_ACC (Q ) config_line(T_ACC_STR, _ACCEL(Q , travel_acceleration), Q ##_STR);
207
+ MAIN_AXIS_MAP (_REPORT_T_ACC);
201
208
202
209
//
203
210
// Printer Type
0 commit comments