3737 #include " ../../module/temperature.h"
3838#endif
3939
40- #include < cstddef>
41-
4240struct ProgStr {
4341 PGM_P ptr;
4442 constexpr ProgStr (PGM_P p) : ptr(p) {}
4543 ProgStr (FSTR_P f) : ptr(FTOP (f)) {}
46- ProgStr (std:: nullptr_t ) : ptr(nullptr ) {}
44+ ProgStr (nullptr_t ) : ptr(nullptr ) {}
4745
4846 constexpr operator PGM_P () const { return ptr; }
4947 constexpr explicit operator bool () const { return ptr != nullptr ; }
@@ -92,13 +90,13 @@ void GcodeSuite::M360() {
9290 //
9391 // Axis letters, in PROGMEM
9492 //
95- #define _DEFINE_A_STR (Q ) PGMSTR (Q##_STR, STR_ ##Q);
93+ #define _DEFINE_A_STR (Q ) static PGMSTR (Q##_STR, STR_ ##Q);
9694 MAIN_AXIS_MAP (_DEFINE_A_STR);
9795
9896 //
9997 // Homing Directions
10098 //
101- PGMSTR (H_DIR_STR , " HomeDir" );
99+ static PGMSTR (H_DIR_STR , " HomeDir" );
102100 #if X_HOME_DIR
103101 config_line (H_DIR_STR , X_HOME_DIR , X_STR );
104102 #endif
@@ -128,14 +126,18 @@ void GcodeSuite::M360() {
128126 #endif
129127
130128 #if ANY(CLASSIC_JERK, HAS_LINEAR_E_JERK)
131- PGMSTR (JERK_STR , " Jerk" );
129+ static PGMSTR (JERK_STR , " Jerk" );
132130 #endif
133131
134132 //
135133 // XYZ Axis Jerk
136134 //
137135 #if ENABLED(CLASSIC_JERK)
138136 #define _REPORT_JERK (Q ) config_line(Q##_STR, planner.max_jerk.Q, JERK_STR );
137+ #define XY_MAP (FUNC ) do { \
138+ TERN_ (HAS_X_AXIS , FUNC (X)) \
139+ TERN_ (HAS_Y_AXIS , FUNC (Y)) \
140+ }while (0 )
139141 if (TERN0 (HAS_Y_AXIS , planner.max_jerk .x == planner.max_jerk .y ))
140142 config_line (F (" XY" ), planner.max_jerk .x , JERK_STR );
141143 else {
@@ -150,9 +152,9 @@ void GcodeSuite::M360() {
150152 //
151153 config_line (F (" SupportG10G11" ), ENABLED (FWRETRACT ));
152154 #if ENABLED(FWRETRACT)
153- PGMSTR (RET_STR , " Retraction" );
154- PGMSTR (UNRET_STR , " RetractionUndo" );
155- PGMSTR (SPEED_STR , " Speed" );
155+ static PGMSTR (RET_STR , " Retraction" );
156+ static PGMSTR (UNRET_STR , " RetractionUndo" );
157+ static PGMSTR (SPEED_STR , " Speed" );
156158 // M10 Retract with swap (long) moves
157159 config_line (F (" Length" ), fwretract.settings .retract_length , RET_STR );
158160 config_line (F (" LongLength" ), fwretract.settings .swap_retract_length , RET_STR );
@@ -175,22 +177,22 @@ void GcodeSuite::M360() {
175177 motion.apply_limits (cmax);
176178 const xyz_pos_t wmin = cmin.asLogical (), wmax = cmax.asLogical ();
177179
178- PGMSTR (MIN_STR , " Min" );
180+ static PGMSTR (MIN_STR , " Min" );
179181 #define _REPORT_MIN (Q ) config_line(MIN_STR , wmin.Q, Q##_STR);
180182 MAIN_AXIS_MAP (_REPORT_MIN);
181183
182- PGMSTR (MAX_STR , " Max" );
184+ static PGMSTR (MAX_STR , " Max" );
183185 #define _REPORT_MAX (Q ) config_line(MAX_STR , wmax.Q, Q##_STR);
184186 MAIN_AXIS_MAP (_REPORT_MAX);
185187
186- PGMSTR (SIZE_STR , " Size" );
188+ static PGMSTR (SIZE_STR , " Size" );
187189 #define _REPORT_SIZE (Q ) config_line(SIZE_STR , wmax.Q - wmin.Q, Q##_STR);
188190 MAIN_AXIS_MAP (_REPORT_SIZE);
189191
190192 //
191193 // Axis Steps per mm
192194 //
193- PGMSTR (S_MM_STR , " Steps/mm" );
195+ static PGMSTR (S_MM_STR , " Steps/mm" );
194196 #define _REPORT_S_MM (Q ) config_line(S_MM_STR , planner.settings.axis_steps_per_mm[_AXIS(Q)], Q##_STR);
195197 MAIN_AXIS_MAP (_REPORT_S_MM);
196198
@@ -199,11 +201,11 @@ void GcodeSuite::M360() {
199201 //
200202 #define _ACCEL (Q,B ) _MIN(planner.settings.max_acceleration_mm_per_s2[Q##_AXIS], planner.settings.B)
201203
202- PGMSTR (P_ACC_STR , " PrintAccel" );
204+ static PGMSTR (P_ACC_STR , " PrintAccel" );
203205 #define _REPORT_P_ACC (Q ) config_line(P_ACC_STR , _ACCEL(Q, acceleration), Q##_STR);
204206 MAIN_AXIS_MAP (_REPORT_P_ACC);
205207
206- PGMSTR (T_ACC_STR , " TravelAccel" );
208+ static PGMSTR (T_ACC_STR , " TravelAccel" );
207209 #define _REPORT_T_ACC (Q ) config_line(T_ACC_STR , _ACCEL(Q, travel_acceleration), Q##_STR);
208210 MAIN_AXIS_MAP (_REPORT_T_ACC);
209211
0 commit comments