Browse Source

Move common strings (#20846)

Scott Lahteine 3 years ago
parent
commit
d33fe2378c
No account linked to committer's email address
38 changed files with 54 additions and 83 deletions
  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 View File

230
   #include "feature/password/password.h"
230
   #include "feature/password/password.h"
231
 #endif
231
 #endif
232
 
232
 
233
-PGMSTR(NUL_STR, "");
234
 PGMSTR(M112_KILL_STR, "M112 Shutdown");
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
 MarlinState marlin_state = MF_INITIALIZING;
235
 MarlinState marlin_state = MF_INITIALIZING;
247
 
236
 

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

108
   inline bool kill_state() { return READ(KILL_PIN) == KILL_PIN_STATE; }
108
   inline bool kill_state() { return READ(KILL_PIN) == KILL_PIN_STATE; }
109
 #endif
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 View File

25
 
25
 
26
 uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE;
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
 #if HAS_MULTI_SERIAL
36
 #if HAS_MULTI_SERIAL
32
   int8_t serial_port_index = 0;
37
   int8_t serial_port_index = 0;
35
 void serialprintPGM(PGM_P str) {
40
 void serialprintPGM(PGM_P str) {
36
   while (const char c = pgm_read_byte(str++)) SERIAL_CHAR(c);
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
 void serial_echopair_PGM(PGM_P const s_P, const char *v)   { serialprintPGM(s_P); SERIAL_ECHO(v); }
47
 void serial_echopair_PGM(PGM_P const s_P, const char *v)   { serialprintPGM(s_P); SERIAL_ECHO(v); }
42
 void serial_echopair_PGM(PGM_P const s_P, char v)          { serialprintPGM(s_P); SERIAL_CHAR(v); }
48
 void serial_echopair_PGM(PGM_P const s_P, char v)          { serialprintPGM(s_P); SERIAL_CHAR(v); }
65
   }
71
   }
66
 }
72
 }
67
 
73
 
68
-extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[];
69
-
70
 void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
74
 void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
71
   if (prefix) serialprintPGM(prefix);
75
   if (prefix) serialprintPGM(prefix);
72
   SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z);
76
   SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z);

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

27
   #include "../feature/ethernet.h"
27
   #include "../feature/ethernet.h"
28
 #endif
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
 enum MarlinDebugFlags : uint8_t {
41
 enum MarlinDebugFlags : uint8_t {
34
   MARLIN_DEBUG_NONE          = 0,
42
   MARLIN_DEBUG_NONE          = 0,
35
   MARLIN_DEBUG_ECHO          = _BV(0), ///< Echo commands in order as they are processed
43
   MARLIN_DEBUG_ECHO          = _BV(0), ///< Echo commands in order as they are processed
50
 extern uint8_t marlin_debug_flags;
58
 extern uint8_t marlin_debug_flags;
51
 #define DEBUGGING(F) (marlin_debug_flags & (MARLIN_DEBUG_## F))
59
 #define DEBUGGING(F) (marlin_debug_flags & (MARLIN_DEBUG_## F))
52
 
60
 
61
+//
62
+// Serial redirection
63
+//
53
 #define SERIAL_BOTH 0x7F
64
 #define SERIAL_BOTH 0x7F
54
 #if HAS_MULTI_SERIAL
65
 #if HAS_MULTI_SERIAL
55
   extern int8_t serial_port_index;
66
   extern int8_t serial_port_index;

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

520
 
520
 
521
   // Resume the SD file from the last position
521
   // Resume the SD file from the last position
522
   char *fn = info.sd_filename;
522
   char *fn = info.sd_filename;
523
-  extern const char M23_STR[];
524
   sprintf_P(cmd, M23_STR, fn);
523
   sprintf_P(cmd, M23_STR, fn);
525
   gcode.process_subcommands_now(cmd);
524
   gcode.process_subcommands_now(cmd);
526
   sprintf_P(cmd, PSTR("M24 S%ld T%ld"), resume_sdpos, info.print_job_elapsed);
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 View File

188
 
188
 
189
   // Send 'N' to force homing before G29 (internal only)
189
   // Send 'N' to force homing before G29 (internal only)
190
   if (parser.seen('N'))
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
   // Don't allow auto-leveling without homing first
193
   // Don't allow auto-leveling without homing first
194
   if (homing_needed_error()) G29_RETURN(false);
194
   if (homing_needed_error()) G29_RETURN(false);

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

38
 #include "../../feature/probe_temp_comp.h"
38
 #include "../../feature/probe_temp_comp.h"
39
 
39
 
40
 #include "../../lcd/marlinui.h"
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
 #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
43
 #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
44
   #include "../../module/printcounter.h"
44
   #include "../../module/printcounter.h"

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

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

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

33
 
33
 
34
 #include "../../MarlinCore.h" // for SP_X_STR, etc.
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
 void M217_report(const bool eeprom=false) {
36
 void M217_report(const bool eeprom=false) {
39
 
37
 
40
   #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
38
   #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)

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

25
 #if DISABLED(EMERGENCY_PARSER)
25
 #if DISABLED(EMERGENCY_PARSER)
26
 
26
 
27
 #include "../gcode.h"
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
 #include "../../module/motion.h" // for quickstop_stepper
29
 #include "../../module/motion.h" // for quickstop_stepper
30
 
30
 
31
 /**
31
 /**

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

310
 
310
 
311
 enum AxisRelative : uint8_t { REL_X, REL_Y, REL_Z, REL_E, E_MODE_ABS, E_MODE_REL };
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
 class GcodeSuite {
315
 class GcodeSuite {
314
 public:
316
 public:
315
 
317
 
371
   static void process_subcommands_now(char * gcode);
373
   static void process_subcommands_now(char * gcode);
372
 
374
 
373
   static inline void home_all_axes(const bool keep_leveling=false) {
375
   static inline void home_all_axes(const bool keep_leveling=false) {
374
-    extern const char G28_STR[];
375
     process_subcommands_now_P(keep_leveling ? G28_STR : TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR));
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 View File

30
 #include "../../libs/buzzer.h"
30
 #include "../../libs/buzzer.h"
31
 #include "../../MarlinCore.h"
31
 #include "../../MarlinCore.h"
32
 
32
 
33
-extern const char SP_Y_STR[], SP_Z_STR[];
34
-
35
 void m206_report() {
33
 void m206_report() {
36
   SERIAL_ECHOLNPAIR_P(PSTR("M206 X"), home_offset.x, SP_Y_STR, home_offset.y, SP_Z_STR, home_offset.z);
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 View File

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

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

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

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

186
 };
186
 };
187
 
187
 
188
 extern GCodeQueue queue;
188
 extern GCodeQueue queue;
189
+
190
+extern const char G28_STR[];

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

471
       // Show the Marlin logo and short build version
471
       // Show the Marlin logo and short build version
472
       // After a delay show the website URL
472
       // After a delay show the website URL
473
       //
473
       //
474
-      extern const char NUL_STR[];
475
       logo_lines(NUL_STR);
474
       logo_lines(NUL_STR);
476
       CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500);
475
       CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500);
477
       CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500);
476
       CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500);

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

544
 
544
 
545
       // Put Relevant Text on Display
545
       // Put Relevant Text on Display
546
 
546
 
547
-      extern const char X_LBL[], Y_LBL[], Z_LBL[];
548
-
549
       // Show X and Y positions at top of screen
547
       // Show X and Y positions at top of screen
550
       u8g.setColorIndex(1);
548
       u8g.setColorIndex(1);
551
       if (PAGE_UNDER(7)) {
549
       if (PAGE_UNDER(7)) {

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

703
           lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
703
           lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
704
         }
704
         }
705
         else if (elapsed_string[0]) {
705
         else if (elapsed_string[0]) {
706
-          extern const char E_LBL[];
707
           lcd_put_u8str_P(PROGRESS_BAR_X, EXTRAS_BASELINE, E_LBL);
706
           lcd_put_u8str_P(PROGRESS_BAR_X, EXTRAS_BASELINE, E_LBL);
708
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
707
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
709
         }
708
         }

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

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

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

28
 
28
 
29
 #include "../../../../libs/numtostr.h"
29
 #include "../../../../libs/numtostr.h"
30
 #include "../../../../module/motion.h"  // for quickstop_stepper, A20 read printing speed, feedrate_percentage
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
 #include "../../../../inc/MarlinConfig.h"
32
 #include "../../../../inc/MarlinConfig.h"
33
 
33
 
34
 // command sending macro's with debugging capability
34
 // command sending macro's with debugging capability

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

36
   w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled());
36
   w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled());
37
 
37
 
38
   #if HAS_FILAMENT_RUNOUT_DISTANCE
38
   #if HAS_FILAMENT_RUNOUT_DISTANCE
39
-    extern const char NUL_STR[];
40
     w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM));
39
     w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM));
41
     w.units(GET_TEXT_F(MSG_UNITS_MM));
40
     w.units(GET_TEXT_F(MSG_UNITS_MM));
42
     w.precision(0);
41
     w.precision(0);

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

120
 
120
 
121
   if (!commandsInQueue()) {
121
   if (!commandsInQueue()) {
122
     if (!isPositionKnown()) {
122
     if (!isPositionKnown()) {
123
-      extern const char G28_STR[];
124
       injectCommands_P(G28_STR);
123
       injectCommands_P(G28_STR);
125
     }
124
     }
126
     else {
125
     else {

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

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

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

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

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

21
  */
21
  */
22
 #include "../../../../inc/MarlinConfigPre.h"
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
 #include "draw_ui.h"
26
 #include "draw_ui.h"
27
 #include "wifi_module.h"
27
 #include "wifi_module.h"
28
 #include "wifi_upload.h"
28
 #include "wifi_upload.h"
29
 #include "SPI_TFT.h"
29
 #include "SPI_TFT.h"
30
 
30
 
31
-#if ENABLED(MKS_WIFI_MODULE)
32
-
33
 #include "../../../../MarlinCore.h"
31
 #include "../../../../MarlinCore.h"
34
 #include "../../../../module/temperature.h"
32
 #include "../../../../module/temperature.h"
35
 #include "../../../../gcode/queue.h"
33
 #include "../../../../gcode/queue.h"
459
   return 1;
457
   return 1;
460
 }
458
 }
461
 
459
 
462
-
463
 #define SEND_OK_TO_WIFI send_to_wifi((uint8_t *)"ok\r\n", strlen("ok\r\n"))
460
 #define SEND_OK_TO_WIFI send_to_wifi((uint8_t *)"ok\r\n", strlen("ok\r\n"))
464
 int send_to_wifi(uint8_t *buf, int len) { return package_to_wifi(WIFI_TRANS_INF, buf, len); }
461
 int send_to_wifi(uint8_t *buf, int len) { return package_to_wifi(WIFI_TRANS_INF, buf, len); }
465
 
462
 
553
   uint8_t tail;
550
   uint8_t tail;
554
 } ESP_PROTOC_FRAME;
551
 } ESP_PROTOC_FRAME;
555
 
552
 
556
-
557
 static int cut_msg_head(uint8_t *msg, uint16_t msgLen, uint16_t cutLen) {
553
 static int cut_msg_head(uint8_t *msg, uint16_t msgLen, uint16_t cutLen) {
558
   if (msgLen < cutLen) return 0;
554
   if (msgLen < cutLen) return 0;
559
 
555
 
1707
   wifi_link_state = WIFI_NOT_CONFIG;
1703
   wifi_link_state = WIFI_NOT_CONFIG;
1708
 }
1704
 }
1709
 
1705
 
1710
-
1711
 void mks_wifi_firmware_update() {
1706
 void mks_wifi_firmware_update() {
1712
   card.openFileRead((char *)ESP_FIRMWARE_FILE);
1707
   card.openFileRead((char *)ESP_FIRMWARE_FILE);
1713
 
1708
 
1826
   return i;
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 View File

1528
   void MarlinUI::resume_print() {
1528
   void MarlinUI::resume_print() {
1529
     reset_status();
1529
     reset_status();
1530
     TERN_(PARK_HEAD_ON_PAUSE, wait_for_heatup = wait_for_user = false);
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
     #ifdef ACTION_ON_RESUME
1532
     #ifdef ACTION_ON_RESUME
1533
       host_action_resume();
1533
       host_action_resume();
1534
     #endif
1534
     #endif

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

66
 
66
 
67
 static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration.");
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
 #if HAS_LEVELING
69
 #if HAS_LEVELING
72
   static bool leveling_was_active = false;
70
   static bool leveling_was_active = false;
73
 #endif
71
 #endif
205
       , []{ corner_probing_done = true; wait_for_probe = false; }
203
       , []{ corner_probing_done = true; wait_for_probe = false; }
206
       , []{ wait_for_probe = false; }
204
       , []{ wait_for_probe = false; }
207
       , GET_TEXT(MSG_LEVEL_CORNERS_RAISE)
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 View File

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

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

82
   }
82
   }
83
 
83
 
84
   void _lcd_delta_calibrate_home() {
84
   void _lcd_delta_calibrate_home() {
85
-    extern const char G28_STR[];
86
     queue.inject_P(G28_STR);
85
     queue.inject_P(G28_STR);
87
     ui.goto_screen(_lcd_calibrate_homing);
86
     ui.goto_screen(_lcd_calibrate_homing);
88
   }
87
   }

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

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

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

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

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

49
   // "Login" or "New Code"
49
   // "Login" or "New Code"
50
   STATIC_ITEM_P(authenticating ? GET_TEXT(MSG_LOGIN_REQUIRED) : GET_TEXT(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT);
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
   // Make the digit edit item look like a sub-menu
54
   // Make the digit edit item look like a sub-menu
55
   PGM_P const label = GET_TEXT(MSG_ENTER_DIGIT);
55
   PGM_P const label = GET_TEXT(MSG_ENTER_DIGIT);

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

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

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

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

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

76
             matrix.vectors[0][2] * _x + matrix.vectors[1][2] * _y + matrix.vectors[2][2] * _z };
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
 void vector_3::debug(PGM_P const title) {
79
 void vector_3::debug(PGM_P const title) {
82
   serialprintPGM(title);
80
   serialprintPGM(title);
83
   SERIAL_ECHOPAIR_F_P(SP_X_STR, x, 6);
81
   SERIAL_ECHOPAIR_F_P(SP_X_STR, x, 6);

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

176
 static const float     _DASU[] PROGMEM = DEFAULT_AXIS_STEPS_PER_UNIT;
176
 static const float     _DASU[] PROGMEM = DEFAULT_AXIS_STEPS_PER_UNIT;
177
 static const feedRate_t _DMF[] PROGMEM = DEFAULT_MAX_FEEDRATE;
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
  * Current EEPROM Layout
180
  * Current EEPROM Layout
183
  *
181
  *
3181
 
3179
 
3182
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
3180
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
3183
 
3181
 
3184
-        config_heading(forReplay, PSTR(""), false);
3182
+        config_heading(forReplay, NUL_STR, false);
3185
         if (!forReplay) {
3183
         if (!forReplay) {
3186
           ubl.echo_name();
3184
           ubl.echo_name();
3187
           SERIAL_CHAR(':');
3185
           SERIAL_CHAR(':');

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

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

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

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

Loading…
Cancel
Save