Pārlūkot izejas kodu

Reduce string duplication

Scott Lahteine 4 gadus atpakaļ
vecāks
revīzija
dc6d8357a6

+ 1
- 0
Marlin/src/MarlinCore.cpp Parādīt failu

@@ -216,6 +216,7 @@ PGMSTR(M24_STR, "M24");
216 216
 PGMSTR(SP_P_STR, " P");  PGMSTR(SP_T_STR, " T");
217 217
 PGMSTR(X_STR,     "X");  PGMSTR(Y_STR,     "Y");  PGMSTR(Z_STR,     "Z");  PGMSTR(E_STR,     "E");
218 218
 PGMSTR(X_LBL,     "X:"); PGMSTR(Y_LBL,     "Y:"); PGMSTR(Z_LBL,     "Z:"); PGMSTR(E_LBL,     "E:");
219
+PGMSTR(SP_A_STR, " A");  PGMSTR(SP_B_STR, " B");  PGMSTR(SP_C_STR, " C");
219 220
 PGMSTR(SP_X_STR, " X");  PGMSTR(SP_Y_STR, " Y");  PGMSTR(SP_Z_STR, " Z");  PGMSTR(SP_E_STR, " E");
220 221
 PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:");
221 222
 

+ 1
- 0
Marlin/src/MarlinCore.h Parādīt failu

@@ -120,5 +120,6 @@ void protected_pin_err();
120 120
 #endif
121 121
 
122 122
 extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
123
+                  SP_A_STR[], SP_B_STR[], SP_C_STR[],
123 124
                   SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[],
124 125
                   X_LBL[], Y_LBL[], Z_LBL[], E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[];

+ 6
- 8
Marlin/src/gcode/bedlevel/G35.cpp Parādīt failu

@@ -127,18 +127,16 @@ void GcodeSuite::G35() {
127 127
     const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true);
128 128
 
129 129
     if (isnan(z_probed_height)) {
130
-      SERIAL_ECHOLNPAIR("G35 failed at point ", int(i), " (", tramming_point_name[i], ")"
131
-                        " X", screws_tilt_adjust_pos[i].x,
132
-                        " Y", screws_tilt_adjust_pos[i].y);
130
+      SERIAL_ECHOPAIR("G35 failed at point ", int(i), " (", tramming_point_name[i], ")");
131
+      SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y);
133 132
       err_break = true;
134 133
       break;
135 134
     }
136 135
 
137
-    if (DEBUGGING(LEVELING))
138
-      DEBUG_ECHOLNPAIR("Probing point ", int(i), " (", tramming_point_name[i], ")"
139
-                       " X", screws_tilt_adjust_pos[i].x,
140
-                       " Y", screws_tilt_adjust_pos[i].y,
141
-                       " Z", z_probed_height);
136
+    if (DEBUGGING(LEVELING)) {
137
+      DEBUG_ECHOPAIR("Probing point ", int(i), " (", tramming_point_name[i], ")");
138
+      SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y, SP_Z_STR, z_probed_height);
139
+    }
142 140
 
143 141
     z_measured[i] = z_probed_height;
144 142
   }

+ 3
- 3
Marlin/src/gcode/config/M217.cpp Parādīt failu

@@ -39,9 +39,9 @@ void M217_report(const bool eeprom=false) {
39 39
 
40 40
   #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
41 41
     serialprintPGM(eeprom ? PSTR("  M217") : PSTR("Toolchange:"));
42
-    SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length),
43
-                    " B", LINEAR_UNIT(toolchange_settings.extra_resume));
44
-    SERIAL_ECHOPAIR_P(SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime),
42
+    SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length));
43
+    SERIAL_ECHOPAIR_P(SP_B_STR, LINEAR_UNIT(toolchange_settings.extra_resume),
44
+                      SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime),
45 45
                       SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed));
46 46
     SERIAL_ECHOPAIR(" R", LINEAR_UNIT(toolchange_settings.retract_speed),
47 47
                     " U", LINEAR_UNIT(toolchange_settings.unretract_speed),

+ 2
- 2
Marlin/src/gcode/queue.cpp Parādīt failu

@@ -289,8 +289,8 @@ void GCodeQueue::ok_to_send() {
289 289
       while (NUMERIC_SIGNED(*p))
290 290
         SERIAL_ECHO(*p++);
291 291
     }
292
-    SERIAL_ECHOPAIR_P(SP_P_STR, int(planner.moves_free()));
293
-    SERIAL_ECHOPAIR(" B", int(BUFSIZE - length));
292
+    SERIAL_ECHOPAIR_P(SP_P_STR, int(planner.moves_free()),
293
+                      SP_B_STR, int(BUFSIZE - length));
294 294
   #endif
295 295
   SERIAL_EOL();
296 296
 }

+ 1
- 1
Marlin/src/lcd/language/language_en.h Parādīt failu

@@ -336,7 +336,7 @@ namespace Language_en {
336 336
   PROGMEM Language_Str MSG_SETTINGS_STORED                 = _UxGT("Settings Stored");
337 337
   PROGMEM Language_Str MSG_MEDIA_UPDATE                    = _UxGT("Media Update");
338 338
   PROGMEM Language_Str MSG_RESET_PRINTER                   = _UxGT("Reset Printer");
339
-  PROGMEM Language_Str MSG_REFRESH                         = LCD_STR_REFRESH  _UxGT("Refresh");
339
+  PROGMEM Language_Str MSG_REFRESH                         = LCD_STR_REFRESH _UxGT("Refresh");
340 340
   PROGMEM Language_Str MSG_INFO_SCREEN                     = _UxGT("Info Screen");
341 341
   PROGMEM Language_Str MSG_PREPARE                         = _UxGT("Prepare");
342 342
   PROGMEM Language_Str MSG_TUNE                            = _UxGT("Tune");

+ 6
- 6
Marlin/src/module/configuration_store.cpp Parādīt failu

@@ -3163,16 +3163,16 @@ void MarlinSettings::reset() {
3163 3163
       CONFIG_ECHO_HEADING("Material heatup parameters:");
3164 3164
       LOOP_L_N(i, PREHEAT_COUNT) {
3165 3165
         CONFIG_ECHO_START();
3166
-        SERIAL_ECHOLNPAIR(
3167
-          "  M145 S", (int)i
3166
+        SERIAL_ECHOLNPAIR_P(
3167
+          PSTR("  M145 S"), (int)i
3168 3168
           #if HAS_HOTEND
3169
-            , " H", TEMP_UNIT(ui.material_preset[i].hotend_temp)
3169
+            , PSTR(" H"), TEMP_UNIT(ui.material_preset[i].hotend_temp)
3170 3170
           #endif
3171 3171
           #if HAS_HEATED_BED
3172
-            , " B", TEMP_UNIT(ui.material_preset[i].bed_temp)
3172
+            , SP_B_STR, TEMP_UNIT(ui.material_preset[i].bed_temp)
3173 3173
           #endif
3174 3174
           #if HAS_FAN
3175
-            , " F", ui.material_preset[i].fan_speed
3175
+            , PSTR(" F"), ui.material_preset[i].fan_speed
3176 3176
           #endif
3177 3177
         );
3178 3178
       }
@@ -3198,7 +3198,7 @@ void MarlinSettings::reset() {
3198 3198
             , PSTR(" D"), unscalePID_d(PID_PARAM(Kd, e))
3199 3199
           );
3200 3200
           #if ENABLED(PID_EXTRUSION_SCALING)
3201
-            SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e));
3201
+            SERIAL_ECHOPAIR_P(SP_C_STR, PID_PARAM(Kc, e));
3202 3202
             if (e == 0) SERIAL_ECHOPAIR(" L", thermalManager.lpq_len);
3203 3203
           #endif
3204 3204
           #if ENABLED(PID_FAN_SCALING)

+ 1
- 1
Marlin/src/module/delta.cpp Parādīt failu

@@ -122,7 +122,7 @@ void recalc_delta_settings() {
122 122
 
123 123
 #define DELTA_DEBUG(VAR) do { \
124 124
     SERIAL_ECHOLNPAIR_P(PSTR("Cartesian X"), VAR.x, SP_Y_STR, VAR.y, SP_Z_STR, VAR.z); \
125
-    SERIAL_ECHOLNPAIR("Delta A", delta.a, " B", delta.b, " C", delta.c); \
125
+    SERIAL_ECHOLNPAIR_P(PSTR("Delta A"), delta.a, SP_B_STR, delta.b, SP_C_STR, delta.c); \
126 126
   }while(0)
127 127
 
128 128
 void inverse_kinematics(const xyz_pos_t &raw) {

+ 2
- 2
Marlin/src/module/temperature.cpp Parādīt failu

@@ -1281,8 +1281,8 @@ void Temperature::manage_heater() {
1281 1281
 
1282 1282
     SERIAL_ECHOPAIR_F(" R", t.series_res, 1);
1283 1283
     SERIAL_ECHOPAIR_F_P(SP_T_STR, t.res_25, 1);
1284
-    SERIAL_ECHOPAIR_F(" B", t.beta, 1);
1285
-    SERIAL_ECHOPAIR_F(" C", t.sh_c_coeff, 9);
1284
+    SERIAL_ECHOPAIR_F_P(SP_B_STR, t.beta, 1);
1285
+    SERIAL_ECHOPAIR_F_P(SP_C_STR, t.sh_c_coeff, 9);
1286 1286
     SERIAL_ECHOPGM(" ; ");
1287 1287
     serialprintPGM(
1288 1288
       TERN_(HEATER_0_USER_THERMISTOR, t_index == CTI_HOTEND_0 ? PSTR("HOTEND 0") :)

Notiek ielāde…
Atcelt
Saglabāt