Sfoglia il codice sorgente

Move common strings (#20846)

Scott Lahteine 3 anni fa
parent
commit
d33fe2378c
Nessun account collegato all'indirizzo email del committer
38 ha cambiato i file con 54 aggiunte e 83 eliminazioni
  1. 0
    11
      Marlin/src/MarlinCore.cpp
  2. 1
    4
      Marlin/src/MarlinCore.h
  3. 10
    6
      Marlin/src/core/serial.cpp
  4. 14
    3
      Marlin/src/core/serial.h
  5. 0
    1
      Marlin/src/feature/powerloss.cpp
  6. 1
    1
      Marlin/src/gcode/bedlevel/abl/G29.cpp
  7. 1
    1
      Marlin/src/gcode/calibrate/G76_M192_M871.cpp
  8. 0
    2
      Marlin/src/gcode/calibrate/M48.cpp
  9. 0
    2
      Marlin/src/gcode/config/M217.cpp
  10. 1
    1
      Marlin/src/gcode/control/M108_M112_M410.cpp
  11. 2
    1
      Marlin/src/gcode/gcode.h
  12. 0
    2
      Marlin/src/gcode/geometry/M206_M428.cpp
  13. 0
    2
      Marlin/src/gcode/probe/M851.cpp
  14. 3
    0
      Marlin/src/gcode/queue.cpp
  15. 2
    0
      Marlin/src/gcode/queue.h
  16. 0
    1
      Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
  17. 0
    2
      Marlin/src/lcd/dogm/marlinui_DOGM.cpp
  18. 0
    1
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp
  19. 0
    2
      Marlin/src/lcd/extui/dgus_lcd.cpp
  20. 1
    1
      Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp
  21. 0
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp
  22. 0
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp
  23. 0
    2
      Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp
  24. 0
    2
      Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp
  25. 2
    8
      Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp
  26. 1
    1
      Marlin/src/lcd/marlinui.cpp
  27. 1
    3
      Marlin/src/lcd/menu/menu_bed_corners.cpp
  28. 0
    2
      Marlin/src/lcd/menu/menu_configuration.cpp
  29. 0
    1
      Marlin/src/lcd/menu/menu_delta_calibrate.cpp
  30. 4
    6
      Marlin/src/lcd/menu/menu_main.cpp
  31. 0
    3
      Marlin/src/lcd/menu/menu_motion.cpp
  32. 1
    1
      Marlin/src/lcd/menu/menu_password.cpp
  33. 0
    1
      Marlin/src/lcd/menu/menu_probe_offset.cpp
  34. 1
    1
      Marlin/src/lcd/tft/ui_480x320.cpp
  35. 0
    2
      Marlin/src/libs/vector_3.cpp
  36. 1
    3
      Marlin/src/module/settings.cpp
  37. 5
    1
      Marlin/src/sd/cardreader.cpp
  38. 2
    0
      Marlin/src/sd/cardreader.h

+ 0
- 11
Marlin/src/MarlinCore.cpp Vedi File

@@ -230,18 +230,7 @@
230 230
   #include "feature/password/password.h"
231 231
 #endif
232 232
 
233
-PGMSTR(NUL_STR, "");
234 233
 PGMSTR(M112_KILL_STR, "M112 Shutdown");
235
-PGMSTR(G28_STR, "G28");
236
-PGMSTR(M21_STR, "M21");
237
-PGMSTR(M23_STR, "M23 %s");
238
-PGMSTR(M24_STR, "M24");
239
-PGMSTR(SP_P_STR, " P");  PGMSTR(SP_T_STR, " T");
240
-PGMSTR(X_STR,     "X");  PGMSTR(Y_STR,     "Y");  PGMSTR(Z_STR,     "Z");  PGMSTR(E_STR,     "E");
241
-PGMSTR(X_LBL,     "X:"); PGMSTR(Y_LBL,     "Y:"); PGMSTR(Z_LBL,     "Z:"); PGMSTR(E_LBL,     "E:");
242
-PGMSTR(SP_A_STR, " A");  PGMSTR(SP_B_STR, " B");  PGMSTR(SP_C_STR, " C");
243
-PGMSTR(SP_X_STR, " X");  PGMSTR(SP_Y_STR, " Y");  PGMSTR(SP_Z_STR, " Z");  PGMSTR(SP_E_STR, " E");
244
-PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:");
245 234
 
246 235
 MarlinState marlin_state = MF_INITIALIZING;
247 236
 

+ 1
- 4
Marlin/src/MarlinCore.h Vedi File

@@ -108,7 +108,4 @@ bool pin_is_protected(const pin_t pin);
108 108
   inline bool kill_state() { return READ(KILL_PIN) == KILL_PIN_STATE; }
109 109
 #endif
110 110
 
111
-extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
112
-                  SP_A_STR[], SP_B_STR[], SP_C_STR[],
113
-                  SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[],
114
-                  X_LBL[], Y_LBL[], Z_LBL[], E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[];
111
+extern const char M112_KILL_STR[];

+ 10
- 6
Marlin/src/core/serial.cpp Vedi File

@@ -25,8 +25,13 @@
25 25
 
26 26
 uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE;
27 27
 
28
-static PGMSTR(errormagic, "Error:");
29
-static PGMSTR(echomagic, "echo:");
28
+// Commonly-used strings in serial output
29
+PGMSTR(NUL_STR,   "");   PGMSTR(SP_P_STR, " P");  PGMSTR(SP_T_STR, " T");
30
+PGMSTR(X_STR,     "X");  PGMSTR(Y_STR,     "Y");  PGMSTR(Z_STR,     "Z");  PGMSTR(E_STR,     "E");
31
+PGMSTR(X_LBL,     "X:"); PGMSTR(Y_LBL,     "Y:"); PGMSTR(Z_LBL,     "Z:"); PGMSTR(E_LBL,     "E:");
32
+PGMSTR(SP_A_STR, " A");  PGMSTR(SP_B_STR, " B");  PGMSTR(SP_C_STR, " C");
33
+PGMSTR(SP_X_STR, " X");  PGMSTR(SP_Y_STR, " Y");  PGMSTR(SP_Z_STR, " Z");  PGMSTR(SP_E_STR, " E");
34
+PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:");
30 35
 
31 36
 #if HAS_MULTI_SERIAL
32 37
   int8_t serial_port_index = 0;
@@ -35,8 +40,9 @@ static PGMSTR(echomagic, "echo:");
35 40
 void serialprintPGM(PGM_P str) {
36 41
   while (const char c = pgm_read_byte(str++)) SERIAL_CHAR(c);
37 42
 }
38
-void serial_echo_start()  { serialprintPGM(echomagic); }
39
-void serial_error_start() { serialprintPGM(errormagic); }
43
+
44
+void serial_echo_start()  { static PGMSTR(echomagic, "echo:"); serialprintPGM(echomagic); }
45
+void serial_error_start() { static PGMSTR(errormagic, "Error:"); serialprintPGM(errormagic); }
40 46
 
41 47
 void serial_echopair_PGM(PGM_P const s_P, const char *v)   { serialprintPGM(s_P); SERIAL_ECHO(v); }
42 48
 void serial_echopair_PGM(PGM_P const s_P, char v)          { serialprintPGM(s_P); SERIAL_CHAR(v); }
@@ -65,8 +71,6 @@ void print_bin(uint16_t val) {
65 71
   }
66 72
 }
67 73
 
68
-extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[];
69
-
70 74
 void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
71 75
   if (prefix) serialprintPGM(prefix);
72 76
   SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z);

+ 14
- 3
Marlin/src/core/serial.h Vedi File

@@ -27,9 +27,17 @@
27 27
   #include "../feature/ethernet.h"
28 28
 #endif
29 29
 
30
-/**
31
- * Define debug bit-masks
32
- */
30
+// Commonly-used strings in serial output
31
+extern const char NUL_STR[], SP_P_STR[], SP_T_STR[],
32
+                  X_STR[], Y_STR[], Z_STR[], E_STR[],
33
+                  X_LBL[], Y_LBL[], Z_LBL[], E_LBL[],
34
+                  SP_A_STR[], SP_B_STR[], SP_C_STR[],
35
+                  SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[],
36
+                  SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[];
37
+
38
+//
39
+// Debugging flags for use by M111
40
+//
33 41
 enum MarlinDebugFlags : uint8_t {
34 42
   MARLIN_DEBUG_NONE          = 0,
35 43
   MARLIN_DEBUG_ECHO          = _BV(0), ///< Echo commands in order as they are processed
@@ -50,6 +58,9 @@ enum MarlinDebugFlags : uint8_t {
50 58
 extern uint8_t marlin_debug_flags;
51 59
 #define DEBUGGING(F) (marlin_debug_flags & (MARLIN_DEBUG_## F))
52 60
 
61
+//
62
+// Serial redirection
63
+//
53 64
 #define SERIAL_BOTH 0x7F
54 65
 #if HAS_MULTI_SERIAL
55 66
   extern int8_t serial_port_index;

+ 0
- 1
Marlin/src/feature/powerloss.cpp Vedi File

@@ -520,7 +520,6 @@ void PrintJobRecovery::resume() {
520 520
 
521 521
   // Resume the SD file from the last position
522 522
   char *fn = info.sd_filename;
523
-  extern const char M23_STR[];
524 523
   sprintf_P(cmd, M23_STR, fn);
525 524
   gcode.process_subcommands_now(cmd);
526 525
   sprintf_P(cmd, PSTR("M24 S%ld T%ld"), resume_sdpos, info.print_job_elapsed);

+ 1
- 1
Marlin/src/gcode/bedlevel/abl/G29.cpp Vedi File

@@ -188,7 +188,7 @@ G29_TYPE GcodeSuite::G29() {
188 188
 
189 189
   // Send 'N' to force homing before G29 (internal only)
190 190
   if (parser.seen('N'))
191
-    gcode.process_subcommands_now_P(TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR));
191
+    process_subcommands_now_P(TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR));
192 192
 
193 193
   // Don't allow auto-leveling without homing first
194 194
   if (homing_needed_error()) G29_RETURN(false);

+ 1
- 1
Marlin/src/gcode/calibrate/G76_M192_M871.cpp Vedi File

@@ -38,7 +38,7 @@
38 38
 #include "../../feature/probe_temp_comp.h"
39 39
 
40 40
 #include "../../lcd/marlinui.h"
41
-#include "../../MarlinCore.h" // for wait_for_heatup, idle(), G28_STR
41
+#include "../../MarlinCore.h" // for wait_for_heatup, idle()
42 42
 
43 43
 #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
44 44
   #include "../../module/printcounter.h"

+ 0
- 2
Marlin/src/gcode/calibrate/M48.cpp Vedi File

@@ -51,8 +51,6 @@
51 51
  * This function requires the machine to be homed before invocation.
52 52
  */
53 53
 
54
-extern const char SP_Y_STR[];
55
-
56 54
 void GcodeSuite::M48() {
57 55
 
58 56
   if (homing_needed_error()) return;

+ 0
- 2
Marlin/src/gcode/config/M217.cpp Vedi File

@@ -33,8 +33,6 @@
33 33
 
34 34
 #include "../../MarlinCore.h" // for SP_X_STR, etc.
35 35
 
36
-extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[];
37
-
38 36
 void M217_report(const bool eeprom=false) {
39 37
 
40 38
   #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)

+ 1
- 1
Marlin/src/gcode/control/M108_M112_M410.cpp Vedi File

@@ -25,7 +25,7 @@
25 25
 #if DISABLED(EMERGENCY_PARSER)
26 26
 
27 27
 #include "../gcode.h"
28
-#include "../../MarlinCore.h" // for wait_for_heatup, kill
28
+#include "../../MarlinCore.h" // for wait_for_heatup, kill, M112_KILL_STR
29 29
 #include "../../module/motion.h" // for quickstop_stepper
30 30
 
31 31
 /**

+ 2
- 1
Marlin/src/gcode/gcode.h Vedi File

@@ -310,6 +310,8 @@
310 310
 
311 311
 enum AxisRelative : uint8_t { REL_X, REL_Y, REL_Z, REL_E, E_MODE_ABS, E_MODE_REL };
312 312
 
313
+extern const char G28_STR[];
314
+
313 315
 class GcodeSuite {
314 316
 public:
315 317
 
@@ -371,7 +373,6 @@ public:
371 373
   static void process_subcommands_now(char * gcode);
372 374
 
373 375
   static inline void home_all_axes(const bool keep_leveling=false) {
374
-    extern const char G28_STR[];
375 376
     process_subcommands_now_P(keep_leveling ? G28_STR : TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR));
376 377
   }
377 378
 

+ 0
- 2
Marlin/src/gcode/geometry/M206_M428.cpp Vedi File

@@ -30,8 +30,6 @@
30 30
 #include "../../libs/buzzer.h"
31 31
 #include "../../MarlinCore.h"
32 32
 
33
-extern const char SP_Y_STR[], SP_Z_STR[];
34
-
35 33
 void m206_report() {
36 34
   SERIAL_ECHOLNPAIR_P(PSTR("M206 X"), home_offset.x, SP_Y_STR, home_offset.y, SP_Z_STR, home_offset.z);
37 35
 }

+ 0
- 2
Marlin/src/gcode/probe/M851.cpp Vedi File

@@ -28,8 +28,6 @@
28 28
 #include "../../feature/bedlevel/bedlevel.h"
29 29
 #include "../../module/probe.h"
30 30
 
31
-extern const char SP_Y_STR[], SP_Z_STR[];
32
-
33 31
 /**
34 32
  * M851: Set the nozzle-to-probe offsets in current units
35 33
  */

+ 3
- 0
Marlin/src/gcode/queue.cpp Vedi File

@@ -56,6 +56,9 @@ GCodeQueue queue;
56 56
   #include "../feature/repeat.h"
57 57
 #endif
58 58
 
59
+// Frequently used G-code strings
60
+PGMSTR(G28_STR, "G28");
61
+
59 62
 /**
60 63
  * GCode line number handling. Hosts may opt to include line numbers when
61 64
  * sending commands to Marlin, and lines will be checked for sequentiality.

+ 2
- 0
Marlin/src/gcode/queue.h Vedi File

@@ -186,3 +186,5 @@ private:
186 186
 };
187 187
 
188 188
 extern GCodeQueue queue;
189
+
190
+extern const char G28_STR[];

+ 0
- 1
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp Vedi File

@@ -471,7 +471,6 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
471 471
       // Show the Marlin logo and short build version
472 472
       // After a delay show the website URL
473 473
       //
474
-      extern const char NUL_STR[];
475 474
       logo_lines(NUL_STR);
476 475
       CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500);
477 476
       CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500);

+ 0
- 2
Marlin/src/lcd/dogm/marlinui_DOGM.cpp Vedi File

@@ -544,8 +544,6 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
544 544
 
545 545
       // Put Relevant Text on Display
546 546
 
547
-      extern const char X_LBL[], Y_LBL[], Z_LBL[];
548
-
549 547
       // Show X and Y positions at top of screen
550 548
       u8g.setColorIndex(1);
551 549
       if (PAGE_UNDER(7)) {

+ 0
- 1
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Vedi File

@@ -703,7 +703,6 @@ void MarlinUI::draw_status_screen() {
703 703
           lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
704 704
         }
705 705
         else if (elapsed_string[0]) {
706
-          extern const char E_LBL[];
707 706
           lcd_put_u8str_P(PROGRESS_BAR_X, EXTRAS_BASELINE, E_LBL);
708 707
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
709 708
         }

+ 0
- 2
Marlin/src/lcd/extui/dgus_lcd.cpp Vedi File

@@ -35,8 +35,6 @@
35 35
 #include "lib/dgus/DGUSDisplayDef.h"
36 36
 #include "lib/dgus/DGUSScreenHandler.h"
37 37
 
38
-extern const char NUL_STR[];
39
-
40 38
 namespace ExtUI {
41 39
 
42 40
   void onStartup() {

+ 1
- 1
Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp Vedi File

@@ -28,7 +28,7 @@
28 28
 
29 29
 #include "../../../../libs/numtostr.h"
30 30
 #include "../../../../module/motion.h"  // for quickstop_stepper, A20 read printing speed, feedrate_percentage
31
-#include "../../../../MarlinCore.h"     // for disable_steppers, G28_STR
31
+#include "../../../../MarlinCore.h"     // for disable_steppers
32 32
 #include "../../../../inc/MarlinConfig.h"
33 33
 
34 34
 // command sending macro's with debugging capability

+ 0
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp Vedi File

@@ -36,7 +36,6 @@ void FilamentRunoutScreen::onRedraw(draw_mode_t what) {
36 36
   w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled());
37 37
 
38 38
   #if HAS_FILAMENT_RUNOUT_DISTANCE
39
-    extern const char NUL_STR[];
40 39
     w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM));
41 40
     w.units(GET_TEXT_F(MSG_UNITS_MM));
42 41
     w.precision(0);

+ 0
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp Vedi File

@@ -120,7 +120,6 @@ void StressTestScreen::onIdle() {
120 120
 
121 121
   if (!commandsInQueue()) {
122 122
     if (!isPositionKnown()) {
123
-      extern const char G28_STR[];
124 123
       injectCommands_P(G28_STR);
125 124
     }
126 125
     else {

+ 0
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp Vedi File

@@ -31,8 +31,6 @@
31 31
 #include "../../../../gcode/queue.h"
32 32
 #include "../../../../inc/MarlinConfig.h"
33 33
 
34
-extern const char G28_STR[];
35
-
36 34
 extern lv_group_t *g;
37 35
 static lv_obj_t *scr;
38 36
 

+ 0
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp Vedi File

@@ -29,8 +29,6 @@
29 29
 #include "../../../../gcode/queue.h"
30 30
 #include "../../../../inc/MarlinConfig.h"
31 31
 
32
-extern const char G28_STR[];
33
-
34 32
 extern lv_group_t *g;
35 33
 static lv_obj_t *scr;
36 34
 

+ 2
- 8
Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp Vedi File

@@ -21,15 +21,13 @@
21 21
  */
22 22
 #include "../../../../inc/MarlinConfigPre.h"
23 23
 
24
-#if HAS_TFT_LVGL_UI
24
+#if BOTH(HAS_TFT_LVGL_UI, MKS_WIFI_MODULE)
25 25
 
26 26
 #include "draw_ui.h"
27 27
 #include "wifi_module.h"
28 28
 #include "wifi_upload.h"
29 29
 #include "SPI_TFT.h"
30 30
 
31
-#if ENABLED(MKS_WIFI_MODULE)
32
-
33 31
 #include "../../../../MarlinCore.h"
34 32
 #include "../../../../module/temperature.h"
35 33
 #include "../../../../gcode/queue.h"
@@ -459,7 +457,6 @@ int package_to_wifi(WIFI_RET_TYPE type, uint8_t *buf, int len) {
459 457
   return 1;
460 458
 }
461 459
 
462
-
463 460
 #define SEND_OK_TO_WIFI send_to_wifi((uint8_t *)"ok\r\n", strlen("ok\r\n"))
464 461
 int send_to_wifi(uint8_t *buf, int len) { return package_to_wifi(WIFI_TRANS_INF, buf, len); }
465 462
 
@@ -553,7 +550,6 @@ typedef struct {
553 550
   uint8_t tail;
554 551
 } ESP_PROTOC_FRAME;
555 552
 
556
-
557 553
 static int cut_msg_head(uint8_t *msg, uint16_t msgLen, uint16_t cutLen) {
558 554
   if (msgLen < cutLen) return 0;
559 555
 
@@ -1707,7 +1703,6 @@ void mks_esp_wifi_init() {
1707 1703
   wifi_link_state = WIFI_NOT_CONFIG;
1708 1704
 }
1709 1705
 
1710
-
1711 1706
 void mks_wifi_firmware_update() {
1712 1707
   card.openFileRead((char *)ESP_FIRMWARE_FILE);
1713 1708
 
@@ -1826,5 +1821,4 @@ int readWifiBuf(int8_t *buf, int32_t len) {
1826 1821
   return i;
1827 1822
 }
1828 1823
 
1829
-#endif // MKS_WIFI_MODULE
1830
-#endif // HAS_TFT_LVGL_UI
1824
+#endif // HAS_TFT_LVGL_UI && MKS_WIFI_MODULE

+ 1
- 1
Marlin/src/lcd/marlinui.cpp Vedi File

@@ -1528,7 +1528,7 @@ void MarlinUI::update() {
1528 1528
   void MarlinUI::resume_print() {
1529 1529
     reset_status();
1530 1530
     TERN_(PARK_HEAD_ON_PAUSE, wait_for_heatup = wait_for_user = false);
1531
-    if (IS_SD_PAUSED()) queue.inject_P(M24_STR);
1531
+    TERN_(SDSUPPORT, if (IS_SD_PAUSED()) queue.inject_P(M24_STR));
1532 1532
     #ifdef ACTION_ON_RESUME
1533 1533
       host_action_resume();
1534 1534
     #endif

+ 1
- 3
Marlin/src/lcd/menu/menu_bed_corners.cpp Vedi File

@@ -66,8 +66,6 @@
66 66
 
67 67
 static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration.");
68 68
 
69
-extern const char G28_STR[];
70
-
71 69
 #if HAS_LEVELING
72 70
   static bool leveling_was_active = false;
73 71
 #endif
@@ -205,7 +203,7 @@ static inline void _lcd_level_bed_corners_get_next_position() {
205 203
       , []{ corner_probing_done = true; wait_for_probe = false; }
206 204
       , []{ wait_for_probe = false; }
207 205
       , GET_TEXT(MSG_LEVEL_CORNERS_RAISE)
208
-      , (const char*)nullptr, PSTR("")
206
+      , (const char*)nullptr, NUL_STR
209 207
     );
210 208
   }
211 209
 

+ 0
- 2
Marlin/src/lcd/menu/menu_configuration.cpp Vedi File

@@ -161,8 +161,6 @@ void menu_advanced_settings();
161 161
   #include "../../module/motion.h"
162 162
   #include "../../gcode/queue.h"
163 163
 
164
-  extern const char G28_STR[];
165
-
166 164
   void menu_tool_offsets() {
167 165
 
168 166
     auto _recalc_offsets = []{

+ 0
- 1
Marlin/src/lcd/menu/menu_delta_calibrate.cpp Vedi File

@@ -82,7 +82,6 @@ void _man_probe_pt(const xy_pos_t &xy) {
82 82
   }
83 83
 
84 84
   void _lcd_delta_calibrate_home() {
85
-    extern const char G28_STR[];
86 85
     queue.inject_P(G28_STR);
87 86
     ui.goto_screen(_lcd_calibrate_homing);
88 87
   }

+ 4
- 6
Marlin/src/lcd/menu/menu_main.cpp Vedi File

@@ -101,8 +101,6 @@ void menu_configuration();
101 101
   void menu_language();
102 102
 #endif
103 103
 
104
-extern const char M21_STR[];
105
-
106 104
 void menu_main() {
107 105
   const bool busy = printingIsActive()
108 106
     #if ENABLED(SDSUPPORT)
@@ -156,7 +154,7 @@ void menu_main() {
156 154
         if (!card_open) {
157 155
           SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY);
158 156
           #if PIN_EXISTS(SD_DETECT)
159
-            GCODES_ITEM(MSG_CHANGE_MEDIA, M21_STR);
157
+            GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21"));
160 158
           #else
161 159
             GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22"));
162 160
           #endif
@@ -166,7 +164,7 @@ void menu_main() {
166 164
         #if PIN_EXISTS(SD_DETECT)
167 165
           ACTION_ITEM(MSG_NO_MEDIA, nullptr);
168 166
         #else
169
-          GCODES_ITEM(MSG_ATTACH_MEDIA, M21_STR);
167
+          GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21"));
170 168
         #endif
171 169
       }
172 170
 
@@ -257,7 +255,7 @@ void menu_main() {
257 255
       if (card_detected) {
258 256
         if (!card_open) {
259 257
           #if PIN_EXISTS(SD_DETECT)
260
-            GCODES_ITEM(MSG_CHANGE_MEDIA, M21_STR);
258
+            GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21"));
261 259
           #else
262 260
             GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22"));
263 261
           #endif
@@ -268,7 +266,7 @@ void menu_main() {
268 266
         #if PIN_EXISTS(SD_DETECT)
269 267
           ACTION_ITEM(MSG_NO_MEDIA, nullptr);
270 268
         #else
271
-          GCODES_ITEM(MSG_ATTACH_MEDIA, M21_STR);
269
+          GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21"));
272 270
         #endif
273 271
       }
274 272
     }

+ 0
- 3
Marlin/src/lcd/menu/menu_motion.cpp Vedi File

@@ -51,8 +51,6 @@
51 51
   float manual_move_e_origin = 0;
52 52
 #endif
53 53
 
54
-extern const char G28_STR[];
55
-
56 54
 //
57 55
 // "Motion" > "Move Axis" submenu
58 56
 //
@@ -191,7 +189,6 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
191 189
       sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
192 190
 
193 191
       #if DISABLED(HAS_GRAPHICAL_TFT)
194
-        extern const char NUL_STR[];
195 192
         SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
196 193
         MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
197 194
         lcd_put_u8str(tmp);

+ 1
- 1
Marlin/src/lcd/menu/menu_password.cpp Vedi File

@@ -49,7 +49,7 @@ void Password::menu_password_entry() {
49 49
   // "Login" or "New Code"
50 50
   STATIC_ITEM_P(authenticating ? GET_TEXT(MSG_LOGIN_REQUIRED) : GET_TEXT(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT);
51 51
 
52
-  STATIC_ITEM_P(PSTR(""), SS_CENTER|SS_INVERT, string);
52
+  STATIC_ITEM_P(NUL_STR, SS_CENTER|SS_INVERT, string);
53 53
 
54 54
   // Make the digit edit item look like a sub-menu
55 55
   PGM_P const label = GET_TEXT(MSG_ENTER_DIGIT);

+ 0
- 1
Marlin/src/lcd/menu/menu_probe_offset.cpp Vedi File

@@ -88,7 +88,6 @@ void probe_offset_wizard_menu() {
88 88
                          !UNEAR_ZERO((FINE_MANUAL_MOVE) *  100 - int((FINE_MANUAL_MOVE) *  100)) ? 3 : 2;
89 89
     sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
90 90
     #if DISABLED(HAS_GRAPHICAL_TFT)
91
-      extern const char NUL_STR[];
92 91
       SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
93 92
       MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
94 93
       lcd_put_u8str(tmp);

+ 1
- 1
Marlin/src/lcd/tft/ui_480x320.cpp Vedi File

@@ -867,7 +867,7 @@ static void moveAxis(AxisEnum axis, const int8_t direction) {
867 867
         NOMORE(ui.manual_move.offset, max - current_position[axis]);
868 868
     #else
869 869
       current_position[axis] += diff;
870
-      const char *msg = PSTR(""); // clear the error
870
+      const char *msg = NUL_STR; // clear the error
871 871
       if (direction < 0 && current_position[axis] < min) {
872 872
         current_position[axis] = min;
873 873
         msg = GET_TEXT(MSG_LCD_SOFT_ENDSTOPS);

+ 0
- 2
Marlin/src/libs/vector_3.cpp Vedi File

@@ -76,8 +76,6 @@ void vector_3::apply_rotation(const matrix_3x3 &matrix) {
76 76
             matrix.vectors[0][2] * _x + matrix.vectors[1][2] * _y + matrix.vectors[2][2] * _z };
77 77
 }
78 78
 
79
-extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[];
80
-
81 79
 void vector_3::debug(PGM_P const title) {
82 80
   serialprintPGM(title);
83 81
   SERIAL_ECHOPAIR_F_P(SP_X_STR, x, 6);

+ 1
- 3
Marlin/src/module/settings.cpp Vedi File

@@ -176,8 +176,6 @@ static const uint32_t   _DMA[] PROGMEM = DEFAULT_MAX_ACCELERATION;
176 176
 static const float     _DASU[] PROGMEM = DEFAULT_AXIS_STEPS_PER_UNIT;
177 177
 static const feedRate_t _DMF[] PROGMEM = DEFAULT_MAX_FEEDRATE;
178 178
 
179
-extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[];
180
-
181 179
 /**
182 180
  * Current EEPROM Layout
183 181
  *
@@ -3181,7 +3179,7 @@ void MarlinSettings::reset() {
3181 3179
 
3182 3180
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
3183 3181
 
3184
-        config_heading(forReplay, PSTR(""), false);
3182
+        config_heading(forReplay, NUL_STR, false);
3185 3183
         if (!forReplay) {
3186 3184
           ubl.echo_name();
3187 3185
           SERIAL_CHAR(':');

+ 5
- 1
Marlin/src/sd/cardreader.cpp Vedi File

@@ -57,6 +57,11 @@
57 57
 #include "../core/debug_out.h"
58 58
 #include "../libs/hex_print.h"
59 59
 
60
+// extern
61
+
62
+PGMSTR(M23_STR, "M23 %s");
63
+PGMSTR(M24_STR, "M24");
64
+
60 65
 // public:
61 66
 
62 67
 card_flags_t CardReader::flag;
@@ -481,7 +486,6 @@ void CardReader::release() {
481 486
  */
482 487
 void CardReader::openAndPrintFile(const char *name) {
483 488
   char cmd[4 + strlen(name) + 1 + 3 + 1]; // Room for "M23 ", filename, "\n", "M24", and null
484
-  extern const char M23_STR[];
485 489
   sprintf_P(cmd, M23_STR, name);
486 490
   for (char *c = &cmd[4]; *c; c++) *c = tolower(*c);
487 491
   strcat_P(cmd, PSTR("\nM24"));

+ 2
- 0
Marlin/src/sd/cardreader.h Vedi File

@@ -27,6 +27,8 @@
27 27
 
28 28
 #if ENABLED(SDSUPPORT)
29 29
 
30
+extern const char M23_STR[], M24_STR[];
31
+
30 32
 #if BOTH(SDCARD_SORT_ALPHA, SDSORT_DYNAMIC_RAM)
31 33
   #define SD_RESORT 1
32 34
 #endif

Loading…
Annulla
Salva