Browse Source

🎨 Apply F() to kill / sendinfoscreen

Scott Lahteine 2 years ago
parent
commit
65b950a489
52 changed files with 149 additions and 123 deletions
  1. 3
    3
      Marlin/src/MarlinCore.cpp
  2. 1
    1
      Marlin/src/MarlinCore.h
  3. 1
    1
      Marlin/src/feature/direct_stepping.cpp
  4. 1
    1
      Marlin/src/feature/encoder_i2c.cpp
  5. 1
    1
      Marlin/src/feature/mmu/mmu2.cpp
  6. 1
    1
      Marlin/src/feature/pause.cpp
  7. 1
    1
      Marlin/src/feature/powerloss.cpp
  8. 1
    1
      Marlin/src/feature/tmc_util.cpp
  9. 1
    1
      Marlin/src/gcode/control/M108_M112_M410.cpp
  10. 1
    1
      Marlin/src/gcode/gcode.cpp
  11. 1
    1
      Marlin/src/gcode/gcode_d.cpp
  12. 1
    1
      Marlin/src/gcode/host/M16.cpp
  13. 1
    1
      Marlin/src/gcode/lcd/M0_M1.cpp
  14. 1
    1
      Marlin/src/gcode/queue.cpp
  15. 1
    1
      Marlin/src/lcd/e3v2/enhanced/dwin.cpp
  16. 1
    1
      Marlin/src/lcd/e3v2/jyersui/dwin.cpp
  17. 2
    2
      Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp
  18. 1
    1
      Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp
  19. 1
    1
      Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.h
  20. 1
    1
      Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp
  21. 1
    1
      Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp
  22. 2
    2
      Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp
  23. 3
    3
      Marlin/src/lcd/extui/dgus/dgus_extui.cpp
  24. 6
    0
      Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h
  25. 6
    0
      Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h
  26. 2
    2
      Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp
  27. 6
    0
      Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h
  28. 6
    0
      Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h
  29. 3
    3
      Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp
  30. 1
    1
      Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h
  31. 1
    1
      Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp
  32. 1
    1
      Marlin/src/lcd/extui/example/example.cpp
  33. 3
    3
      Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp
  34. 21
    20
      Marlin/src/lcd/extui/malyan/malyan.cpp
  35. 3
    3
      Marlin/src/lcd/extui/malyan/malyan.h
  36. 12
    12
      Marlin/src/lcd/extui/malyan/malyan_extui.cpp
  37. 1
    1
      Marlin/src/lcd/extui/mks_ui/wifi_module.cpp
  38. 1
    1
      Marlin/src/lcd/extui/nextion/nextion_extui.cpp
  39. 5
    5
      Marlin/src/lcd/extui/nextion/nextion_tft.cpp
  40. 2
    2
      Marlin/src/lcd/extui/nextion/nextion_tft_defs.h
  41. 2
    1
      Marlin/src/lcd/extui/ui_api.cpp
  42. 1
    1
      Marlin/src/lcd/extui/ui_api.h
  43. 2
    2
      Marlin/src/lcd/marlinui.cpp
  44. 2
    2
      Marlin/src/lcd/marlinui.h
  45. 1
    1
      Marlin/src/module/endstops.cpp
  46. 1
    1
      Marlin/src/module/motion.cpp
  47. 1
    1
      Marlin/src/module/planner.cpp
  48. 1
    1
      Marlin/src/module/probe.cpp
  49. 26
    26
      Marlin/src/module/temperature.cpp
  50. 1
    1
      Marlin/src/module/temperature.h
  51. 1
    1
      Marlin/src/module/tool_change.cpp
  52. 1
    1
      Marlin/src/sd/cardreader.cpp

+ 3
- 3
Marlin/src/MarlinCore.cpp View File

@@ -852,16 +852,16 @@ void idle(bool no_stepper_sleep/*=false*/) {
852 852
  * Kill all activity and lock the machine.
853 853
  * After this the machine will need to be reset.
854 854
  */
855
-void kill(PGM_P const lcd_error/*=nullptr*/, PGM_P const lcd_component/*=nullptr*/, const bool steppers_off/*=false*/) {
855
+void kill(FSTR_P const lcd_error/*=nullptr*/, FSTR_P const lcd_component/*=nullptr*/, const bool steppers_off/*=false*/) {
856 856
   thermalManager.disable_all_heaters();
857 857
 
858 858
   TERN_(HAS_CUTTER, cutter.kill()); // Full cutter shutdown including ISR control
859 859
 
860 860
   // Echo the LCD message to serial for extra context
861
-  if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNPGM_P(lcd_error); }
861
+  if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNF(lcd_error); }
862 862
 
863 863
   #if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED)
864
-    ui.kill_screen(lcd_error ?: GET_TEXT(MSG_KILLED), lcd_component ?: NUL_STR);
864
+    ui.kill_screen(lcd_error ?: GET_TEXT_F(MSG_KILLED), lcd_component ?: FPSTR(NUL_STR));
865 865
   #else
866 866
     UNUSED(lcd_error); UNUSED(lcd_component);
867 867
   #endif

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

@@ -38,7 +38,7 @@ inline void idle_no_sleep() { idle(true); }
38 38
   extern bool G38_did_trigger;      // Flag from the ISR to indicate the endstop changed
39 39
 #endif
40 40
 
41
-void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false);
41
+void kill(FSTR_P const lcd_error=nullptr, FSTR_P const lcd_component=nullptr, const bool steppers_off=false);
42 42
 void minkill(const bool steppers_off=false);
43 43
 
44 44
 // Global State of the firmware

+ 1
- 1
Marlin/src/feature/direct_stepping.cpp View File

@@ -174,7 +174,7 @@ namespace DirectStepping {
174 174
   template <typename Cfg>
175 175
   void SerialPageManager<Cfg>::write_responses() {
176 176
     if (fatal_error) {
177
-      kill(GET_TEXT(MSG_BAD_PAGE));
177
+      kill(GET_TEXT_F(MSG_BAD_PAGE));
178 178
       return;
179 179
     }
180 180
 

+ 1
- 1
Marlin/src/feature/encoder_i2c.cpp View File

@@ -153,7 +153,7 @@ void I2CPositionEncoder::update() {
153 153
 
154 154
     #ifdef I2CPE_ERR_THRESH_ABORT
155 155
       if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.settings.axis_steps_per_mm[encoderAxis]) {
156
-        //kill(PSTR("Significant Error"));
156
+        //kill(F("Significant Error"));
157 157
         SERIAL_ECHOLNPGM("Axis error over threshold, aborting!", error);
158 158
         safe_delay(5000);
159 159
       }

+ 1
- 1
Marlin/src/feature/mmu/mmu2.cpp View File

@@ -448,7 +448,7 @@ bool MMU2::rx_ok() {
448 448
 void MMU2::check_version() {
449 449
   if (buildnr < MMU_REQUIRED_FW_BUILDNR) {
450 450
     SERIAL_ERROR_MSG("Invalid MMU2 firmware. Version >= " STRINGIFY(MMU_REQUIRED_FW_BUILDNR) " required.");
451
-    kill(GET_TEXT(MSG_KILL_MMU2_FIRMWARE));
451
+    kill(GET_TEXT_F(MSG_KILL_MMU2_FIRMWARE));
452 452
   }
453 453
 }
454 454
 

+ 1
- 1
Marlin/src/feature/pause.cpp View File

@@ -254,7 +254,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
254 254
 
255 255
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)));
256 256
     TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
257
-    TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT(MSG_FILAMENT_CHANGE_PURGE), CONTINUE_STR));
257
+    TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
258 258
     wait_for_user = true; // A click or M108 breaks the purge_length loop
259 259
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
260 260
       unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);

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

@@ -301,7 +301,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW
301 301
       retract_and_lift(zraise);
302 302
     #endif
303 303
 
304
-    kill(GET_TEXT(MSG_OUTAGE_RECOVERY));
304
+    kill(GET_TEXT_F(MSG_OUTAGE_RECOVERY));
305 305
   }
306 306
 
307 307
 #endif

+ 1
- 1
Marlin/src/feature/tmc_util.cpp View File

@@ -212,7 +212,7 @@
212 212
       if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature");
213 213
       if (data.is_s2g) SERIAL_ECHOLNPGM("coil short circuit");
214 214
       TERN_(TMC_DEBUG, tmc_report_all());
215
-      kill(PSTR("Driver error"));
215
+      kill(F("Driver error"));
216 216
     }
217 217
   #endif
218 218
 

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

@@ -40,7 +40,7 @@ void GcodeSuite::M108() {
40 40
  * M112: Full Shutdown
41 41
  */
42 42
 void GcodeSuite::M112() {
43
-  kill(M112_KILL_STR, nullptr, true);
43
+  kill(FPSTR(M112_KILL_STR), nullptr, true);
44 44
 }
45 45
 
46 46
 /**

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

@@ -261,7 +261,7 @@ void GcodeSuite::dwell(millis_t time) {
261 261
       #ifdef ACTION_ON_CANCEL
262 262
         host_action_cancel();
263 263
       #endif
264
-      kill(GET_TEXT(MSG_LCD_PROBING_FAILED));
264
+      kill(GET_TEXT_F(MSG_LCD_PROBING_FAILED));
265 265
     #endif
266 266
   }
267 267
 

+ 1
- 1
Marlin/src/gcode/gcode_d.cpp View File

@@ -58,7 +58,7 @@ void GcodeSuite::D(const int16_t dcode) {
58 58
       break;
59 59
 
60 60
     case 10:
61
-      kill(PSTR("D10"), PSTR("KILL TEST"), parser.seen_test('P'));
61
+      kill(F("D10"), F("KILL TEST"), parser.seen_test('P'));
62 62
       break;
63 63
 
64 64
     case 1: {

+ 1
- 1
Marlin/src/gcode/host/M16.cpp View File

@@ -33,7 +33,7 @@
33 33
 void GcodeSuite::M16() {
34 34
 
35 35
   if (strcmp_P(parser.string_arg, PSTR(MACHINE_NAME)))
36
-    kill(GET_TEXT(MSG_KILL_EXPECTED_PRINTER));
36
+    kill(GET_TEXT_F(MSG_KILL_EXPECTED_PRINTER));
37 37
 
38 38
 }
39 39
 

+ 1
- 1
Marlin/src/gcode/lcd/M0_M1.cpp View File

@@ -67,7 +67,7 @@ void GcodeSuite::M0_M1() {
67 67
 
68 68
   #elif ENABLED(EXTENSIBLE_UI)
69 69
     if (parser.string_arg)
70
-      ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
70
+      ExtUI::onUserConfirmRequired(parser.string_arg); // String in an SRAM buffer
71 71
     else
72 72
       ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_USERWAIT));
73 73
   #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)

+ 1
- 1
Marlin/src/gcode/queue.cpp View File

@@ -523,7 +523,7 @@ void GCodeQueue::get_serial_commands() {
523 523
           // Process critical commands early
524 524
           if (command[0] == 'M') switch (command[3]) {
525 525
             case '8': if (command[2] == '0' && command[1] == '1') { wait_for_heatup = false; TERN_(HAS_LCD_MENU, wait_for_user = false); } break;
526
-            case '2': if (command[2] == '1' && command[1] == '1') kill(M112_KILL_STR, nullptr, true); break;
526
+            case '2': if (command[2] == '1' && command[1] == '1') kill(FPSTR(M112_KILL_STR), nullptr, true); break;
527 527
             case '0': if (command[1] == '4' && command[2] == '1') quickstop_stepper(); break;
528 528
           }
529 529
         #endif

+ 1
- 1
Marlin/src/lcd/e3v2/enhanced/dwin.cpp View File

@@ -1850,7 +1850,7 @@ void DWIN_LoadSettings(const char *buff) {
1850 1850
   feedrate_percentage = 100;
1851 1851
 }
1852 1852
 
1853
-void MarlinUI::kill_screen(PGM_P lcd_error, PGM_P lcd_component) {
1853
+void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) {
1854 1854
   DWIN_Draw_Popup(ICON_BLTouch, lcd_error, lcd_component);
1855 1855
   DWIN_UpdateLCD();
1856 1856
 }

+ 1
- 1
Marlin/src/lcd/e3v2/jyersui/dwin.cpp View File

@@ -949,7 +949,7 @@ void CrealityDWINClass::Draw_Popup(FSTR_P const line1, FSTR_P const line2, FSTR_
949 949
   }
950 950
 }
951 951
 
952
-void MarlinUI::kill_screen(PGM_P const error, PGM_P const component) {
952
+void MarlinUI::kill_screen(FSTR_P const error, FSTR_P const) {
953 953
   CrealityDWIN.Draw_Popup(F("Printer Kill Reason:"), error, F("Restart Required"), Wait, ICON_BLTouch);
954 954
 }
955 955
 

+ 2
- 2
Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp View File

@@ -41,8 +41,8 @@ namespace ExtUI {
41 41
 
42 42
   void onIdle() { Chiron.IdleLoop(); }
43 43
 
44
-  void onPrinterKilled(PGM_P const error, PGM_P const component) {
45
-    Chiron.PrinterKilled(error,component);
44
+  void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
45
+    Chiron.PrinterKilled(error, component);
46 46
   }
47 47
 
48 48
   void onMediaInserted() { Chiron.MediaEvent(AC_media_inserted); }

+ 1
- 1
Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp View File

@@ -126,7 +126,7 @@ void ChironTFT::IdleLoop()  {
126 126
   CheckHeaters();
127 127
 }
128 128
 
129
-void ChironTFT::PrinterKilled(PGM_P error,PGM_P component)  {
129
+void ChironTFT::PrinterKilled(FSTR_P const error, FSTR_P const component)  {
130 130
   SendtoTFTLN(AC_msg_kill_lcd);
131 131
   #if ACDEBUG(AC_MARLIN)
132 132
     SERIAL_ECHOLNPGM("PrinterKilled()\nerror: ", error , "\ncomponent: ", component);

+ 1
- 1
Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.h View File

@@ -59,7 +59,7 @@ class ChironTFT {
59 59
   public:
60 60
     static void Startup();
61 61
     static void IdleLoop();
62
-    static void PrinterKilled(PGM_P, PGM_P);
62
+    static void PrinterKilled(FSTR_P, FSTR_P);
63 63
     static void MediaEvent(media_event_t);
64 64
     static void TimerEvent(timer_event_t);
65 65
     static void FilamentRunout();

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

@@ -37,7 +37,7 @@ namespace ExtUI {
37 37
 
38 38
   void onStartup()        { AnycubicTFT.OnSetup(); }
39 39
   void onIdle()           { AnycubicTFT.OnCommandScan(); }
40
-  void onPrinterKilled(PGM_P const error, PGM_P const component) { AnycubicTFT.OnKillTFT(); }
40
+  void onPrinterKilled(FSTR_P const error, FSTR_P const component) { AnycubicTFT.OnKillTFT(); }
41 41
   void onMediaInserted()  { AnycubicTFT.OnSDCardStateChange(true); }
42 42
   void onMediaError()     { AnycubicTFT.OnSDCardError(); }
43 43
   void onMediaRemoved()   { AnycubicTFT.OnSDCardStateChange(false); }

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

@@ -654,7 +654,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
654 654
             break;
655 655
 
656 656
           case 12: // A12 kill
657
-            kill(PSTR(STR_ERR_KILLED));
657
+            kill(F(STR_ERR_KILLED));
658 658
             break;
659 659
 
660 660
           case 13: // A13 SELECTION FILE

+ 2
- 2
Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp View File

@@ -340,7 +340,7 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
340 340
 
341 341
   void DGUSScreenHandler::SDCardError() {
342 342
     DGUSScreenHandler::SDCardRemoved();
343
-    sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("SD card error"), nullptr, true, true, true, true);
343
+    sendinfoscreen(F("NOTICE"), nullptr, F("SD card error"), nullptr, true, true, true, true);
344 344
     SetupConfirmAction(nullptr);
345 345
     GotoScreen(DGUSLCD_SCREEN_POPUP);
346 346
   }
@@ -567,7 +567,7 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
567 567
     if (buf[0]) queue.enqueue_one_now(buf);
568 568
 
569 569
     #if ENABLED(DGUS_UI_WAITING)
570
-      sendinfoscreen(PSTR("PID is autotuning"), PSTR("please wait"), NUL_STR, NUL_STR, true, true, true, true);
570
+      sendinfoscreen(F("PID is autotuning"), F("please wait"), NUL_STR, NUL_STR, true, true, true, true);
571 571
       GotoScreen(DGUSLCD_SCREEN_WAITING);
572 572
     #endif
573 573
   }

+ 3
- 3
Marlin/src/lcd/extui/dgus/dgus_extui.cpp View File

@@ -42,8 +42,8 @@ namespace ExtUI {
42 42
 
43 43
   void onIdle() { ScreenHandler.loop(); }
44 44
 
45
-  void onPrinterKilled(PGM_P const error, PGM_P const component) {
46
-    ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, NUL_STR, GET_TEXT(MSG_PLEASE_RESET), true, true, true, true);
45
+  void onPrinterKilled(FSTR_P const error, FSTR_P const) {
46
+    ScreenHandler.sendinfoscreen(GET_TEXT_F(MSG_HALTED), error, FPSTR(NUL_STR), GET_TEXT_F(MSG_PLEASE_RESET), true, true, true, true);
47 47
     ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL);
48 48
     while (!ScreenHandler.loop());  // Wait while anything is left to be sent
49 49
   }
@@ -60,7 +60,7 @@ namespace ExtUI {
60 60
 
61 61
   void onUserConfirmRequired(const char * const msg) {
62 62
     if (msg) {
63
-      ScreenHandler.sendinfoscreen(PSTR("Please confirm."), nullptr, msg, nullptr, true, true, false, true);
63
+      ScreenHandler.sendinfoscreen(F("Please confirm."), nullptr, msg, nullptr, true, true, false, true);
64 64
       ScreenHandler.SetupConfirmAction(setUserConfirmed);
65 65
       ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POPUP);
66 66
     }

+ 6
- 0
Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h View File

@@ -38,6 +38,12 @@ public:
38 38
   // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
39 39
   // The bools specifying whether the strings are in RAM or FLASH.
40 40
   static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
41
+  static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
42
+    sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
43
+  }
44
+  static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
45
+    sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
46
+  }
41 47
 
42 48
   static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
43 49
 

+ 6
- 0
Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h View File

@@ -38,6 +38,12 @@ public:
38 38
   // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
39 39
   // The bools specifying whether the strings are in RAM or FLASH.
40 40
   static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
41
+  static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
42
+    sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
43
+  }
44
+  static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
45
+    sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
46
+  }
41 47
 
42 48
   static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
43 49
 

+ 2
- 2
Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp View File

@@ -1233,7 +1233,7 @@ void DGUSScreenHandler::MKS_FilamentLoadUnload(DGUS_VP_Variable &var, void *val_
1233 1233
   #if BOTH(HAS_HOTEND, PREVENT_COLD_EXTRUSION)
1234 1234
     if (hotend_too_cold) {
1235 1235
       if (thermalManager.targetTooColdToExtrude(hotend_too_cold - 1)) thermalManager.setTargetHotend(thermalManager.extrude_min_temp, hotend_too_cold - 1);
1236
-      sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please wait."), PSTR("Nozzle heating!"), true, true, true, true);
1236
+      sendinfoscreen(F("NOTICE"), nullptr, F("Please wait."), F("Nozzle heating!"), true, true, true, true);
1237 1237
       SetupConfirmAction(nullptr);
1238 1238
       GotoScreen(DGUSLCD_SCREEN_POPUP);
1239 1239
     }
@@ -1489,7 +1489,7 @@ void DGUSScreenHandler::DGUS_Runout_Idle(void) {
1489 1489
         queue.inject(F("M25"));
1490 1490
         GotoScreen(MKSLCD_SCREEN_PAUSE);
1491 1491
 
1492
-        sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please change filament!"), nullptr, true, true, true, true);
1492
+        sendinfoscreen(F("NOTICE"), nullptr, F("Please change filament!"), nullptr, true, true, true, true);
1493 1493
         //SetupConfirmAction(nullptr);
1494 1494
         GotoScreen(DGUSLCD_SCREEN_POPUP);
1495 1495
         break;

+ 6
- 0
Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h View File

@@ -38,6 +38,12 @@ public:
38 38
   // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
39 39
   // The bools specifying whether the strings are in RAM or FLASH.
40 40
   static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
41
+  static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
42
+    sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
43
+  }
44
+  static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
45
+    sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
46
+  }
41 47
 
42 48
   static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
43 49
 

+ 6
- 0
Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h View File

@@ -38,6 +38,12 @@ public:
38 38
   // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
39 39
   // The bools specifying whether the strings are in RAM or FLASH.
40 40
   static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
41
+  static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
42
+    sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
43
+  }
44
+  static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
45
+    sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
46
+  }
41 47
 
42 48
   static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
43 49
 

+ 3
- 3
Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp View File

@@ -159,9 +159,9 @@ void DGUSScreenHandler::Loop() {
159 159
   dgus_display.Loop();
160 160
 }
161 161
 
162
-void DGUSScreenHandler::PrinterKilled(PGM_P error, PGM_P component) {
163
-  SetMessageLinePGM(error, 1);
164
-  SetMessageLinePGM(component, 2);
162
+void DGUSScreenHandler::PrinterKilled(FSTR_P const error, FSTR_P const component) {
163
+  SetMessageLinePGM(FTOP(error), 1);
164
+  SetMessageLinePGM(FTOP(component), 2);
165 165
   SetMessageLinePGM(NUL_STR, 3);
166 166
   SetMessageLinePGM(GET_TEXT(MSG_PLEASE_RESET), 4);
167 167
 

+ 1
- 1
Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h View File

@@ -37,7 +37,7 @@ public:
37 37
   static void Ready();
38 38
   static void Loop();
39 39
 
40
-  static void PrinterKilled(PGM_P error, PGM_P component);
40
+  static void PrinterKilled(FSTR_P const error, FSTR_P const component);
41 41
   static void UserConfirmRequired(const char * const msg);
42 42
   static void SettingsReset();
43 43
   static void StoreSettings(char *buff);

+ 1
- 1
Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp View File

@@ -46,7 +46,7 @@ namespace ExtUI {
46 46
     }
47 47
   }
48 48
 
49
-  void onPrinterKilled(PGM_P error, PGM_P component) {
49
+  void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
50 50
     dgus_screen_handler.PrinterKilled(error, component);
51 51
   }
52 52
 

+ 1
- 1
Marlin/src/lcd/extui/example/example.cpp View File

@@ -46,7 +46,7 @@ namespace ExtUI {
46 46
      */
47 47
   }
48 48
   void onIdle() {}
49
-  void onPrinterKilled(PGM_P const error, PGM_P const component) {}
49
+  void onPrinterKilled(FSTR_P const error, FSTR_P const component) {}
50 50
   void onMediaInserted() {}
51 51
   void onMediaError() {}
52 52
   void onMediaRemoved() {}

+ 3
- 3
Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp View File

@@ -38,9 +38,9 @@ namespace ExtUI {
38 38
 
39 39
   void onIdle() { EventLoop::loop(); }
40 40
 
41
-  void onPrinterKilled(PGM_P const error, PGM_P const component) {
42
-    char str[strlen_P(error) + strlen_P(component) + 3];
43
-    sprintf_P(str, PSTR(S_FMT ": " S_FMT), error, component);
41
+  void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
42
+    char str[strlen_P(FTOP(error)) + strlen_P(FTOP(component)) + 3];
43
+    sprintf_P(str, PSTR(S_FMT ": " S_FMT), FTOP(error), FTOP(component));
44 44
     KillScreen::show(str);
45 45
   }
46 46
 

+ 21
- 20
Marlin/src/lcd/extui/malyan/malyan.cpp View File

@@ -74,35 +74,36 @@ uint16_t inbound_count;
74 74
 bool last_printing_status = false;
75 75
 
76 76
 // Everything written needs the high bit set.
77
-void write_to_lcd_P(PGM_P const message) {
77
+void write_to_lcd(FSTR_P const fmsg) {
78
+  PGM_P pmsg = FTOP(fmsg);
78 79
   char encoded_message[MAX_CURLY_COMMAND];
79
-  uint8_t message_length = _MIN(strlen_P(message), sizeof(encoded_message));
80
+  uint8_t message_length = _MIN(strlen_P(pmsg), sizeof(encoded_message));
80 81
 
81 82
   LOOP_L_N(i, message_length)
82
-    encoded_message[i] = pgm_read_byte(&message[i]) | 0x80;
83
+    encoded_message[i] = pgm_read_byte(&pmsg[i]) | 0x80;
83 84
 
84 85
   LCD_SERIAL.Print::write(encoded_message, message_length);
85 86
 }
86 87
 
87
-void write_to_lcd(const char * const message) {
88
+void write_to_lcd(const char * const cmsg) {
88 89
   char encoded_message[MAX_CURLY_COMMAND];
89
-  const uint8_t message_length = _MIN(strlen(message), sizeof(encoded_message));
90
+  const uint8_t message_length = _MIN(strlen(cmsg), sizeof(encoded_message));
90 91
 
91 92
   LOOP_L_N(i, message_length)
92
-    encoded_message[i] = message[i] | 0x80;
93
+    encoded_message[i] = cmsg[i] | 0x80;
93 94
 
94 95
   LCD_SERIAL.Print::write(encoded_message, message_length);
95 96
 }
96 97
 
97 98
 // {E:<msg>} is for error states.
98
-void set_lcd_error_P(PGM_P const error, PGM_P const component/*=nullptr*/) {
99
-  write_to_lcd_P(PSTR("{E:"));
100
-  write_to_lcd_P(error);
99
+void set_lcd_error(FSTR_P const error, FSTR_P const component/*=nullptr*/) {
100
+  write_to_lcd(F("{E:"));
101
+  write_to_lcd(error);
101 102
   if (component) {
102
-    write_to_lcd_P(PSTR(" "));
103
-    write_to_lcd_P(component);
103
+    write_to_lcd(F(" "));
104
+    write_to_lcd(component);
104 105
   }
105
-  write_to_lcd_P(PSTR("}"));
106
+  write_to_lcd(F("}"));
106 107
 }
107 108
 
108 109
 
@@ -243,16 +244,16 @@ void process_lcd_p_command(const char *command) {
243 244
   switch (command[0]) {
244 245
     case 'P':
245 246
         ExtUI::pausePrint();
246
-        write_to_lcd_P(PSTR("{SYS:PAUSED}"));
247
+        write_to_lcd(F("{SYS:PAUSED}"));
247 248
         break;
248 249
     case 'R':
249 250
         ExtUI::resumePrint();
250
-        write_to_lcd_P(PSTR("{SYS:RESUMED}"));
251
+        write_to_lcd(F("{SYS:RESUMED}"));
251 252
         break;
252 253
     case 'X':
253
-        write_to_lcd_P(PSTR("{SYS:CANCELING}"));
254
+        write_to_lcd(F("{SYS:CANCELING}"));
254 255
         ExtUI::stopPrint();
255
-        write_to_lcd_P(PSTR("{SYS:STARTED}"));
256
+        write_to_lcd(F("{SYS:STARTED}"));
256 257
         break;
257 258
     case 'H': queue.enqueue_now_P(G28_STR); break; // Home all axes
258 259
     default: {
@@ -271,13 +272,13 @@ void process_lcd_p_command(const char *command) {
271 272
         // but the V2 LCD switches to "print" mode on {SYS:DIR} response.
272 273
         if (card.flag.filenameIsDir) {
273 274
           card.cd(card.filename);
274
-          write_to_lcd_P(PSTR("{SYS:DIR}"));
275
+          write_to_lcd(F("{SYS:DIR}"));
275 276
         }
276 277
         else {
277 278
           char message_buffer[MAX_CURLY_COMMAND];
278 279
           sprintf_P(message_buffer, PSTR("{PRINTFILE:%s}"), card.longest_filename());
279 280
           write_to_lcd(message_buffer);
280
-          write_to_lcd_P(PSTR("{SYS:BUILD}"));
281
+          write_to_lcd(F("{SYS:BUILD}"));
281 282
           card.openAndPrintFile(card.filename);
282 283
         }
283 284
       #endif
@@ -332,7 +333,7 @@ void process_lcd_s_command(const char *command) {
332 333
           write_to_lcd(message_buffer);
333 334
         }
334 335
 
335
-        write_to_lcd_P(PSTR("{SYS:OK}"));
336
+        write_to_lcd(F("{SYS:OK}"));
336 337
       #endif
337 338
     } break;
338 339
 
@@ -413,7 +414,7 @@ void update_usb_status(const bool forceUpdate) {
413 414
   // This is more logical.
414 415
   if (last_usb_connected_status != MYSERIAL1.connected() || forceUpdate) {
415 416
     last_usb_connected_status = MYSERIAL1.connected();
416
-    write_to_lcd_P(last_usb_connected_status ? PSTR("{R:UC}\r\n") : PSTR("{R:UD}\r\n"));
417
+    write_to_lcd(last_usb_connected_status ? F("{R:UC}\r\n") : F("{R:UD}\r\n"));
417 418
   }
418 419
 }
419 420
 

+ 3
- 3
Marlin/src/lcd/extui/malyan/malyan.h View File

@@ -33,10 +33,10 @@ extern uint16_t inbound_count;
33 33
 // For sending print completion messages
34 34
 extern bool last_printing_status;
35 35
 
36
-void write_to_lcd_P(PGM_P const message);
37
-void write_to_lcd(const char * const message);
36
+void write_to_lcd(FSTR_P const fmsg);
37
+void write_to_lcd(const char * const cmsg);
38 38
 
39
-void set_lcd_error_P(PGM_P const error, PGM_P const component=nullptr);
39
+void set_lcd_error(FSTR_P const error, FSTR_P const component=nullptr);
40 40
 
41 41
 void process_lcd_c_command(const char *command);
42 42
 void process_lcd_eb_command(const char *command);

+ 12
- 12
Marlin/src/lcd/extui/malyan/malyan_extui.cpp View File

@@ -55,13 +55,13 @@ namespace ExtUI {
55 55
     LCD_SERIAL.begin(LCD_BAUDRATE);
56 56
 
57 57
     // Signal init
58
-    write_to_lcd_P(PSTR("{SYS:STARTED}\r\n"));
58
+    write_to_lcd(F("{SYS:STARTED}\r\n"));
59 59
 
60 60
     // send a version that says "unsupported"
61
-    write_to_lcd_P(PSTR("{VER:99}\r\n"));
61
+    write_to_lcd(F("{VER:99}\r\n"));
62 62
 
63 63
     // No idea why it does this twice.
64
-    write_to_lcd_P(PSTR("{SYS:STARTED}\r\n"));
64
+    write_to_lcd(F("{SYS:STARTED}\r\n"));
65 65
     update_usb_status(true);
66 66
   }
67 67
 
@@ -98,8 +98,8 @@ namespace ExtUI {
98 98
     #endif
99 99
   }
100 100
 
101
-  void onPrinterKilled(PGM_P const error, PGM_P const component) {
102
-    set_lcd_error_P(error, component);
101
+  void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
102
+    set_lcd_error(error, component);
103 103
   }
104 104
 
105 105
   #if HAS_PID_HEATING
@@ -109,28 +109,28 @@ namespace ExtUI {
109 109
       //SERIAL_ECHOLNPGM("OnPidTuning:", rst);
110 110
       switch (rst) {
111 111
         case PID_STARTED:
112
-          set_lcd_error_P(GET_TEXT(MSG_PID_AUTOTUNE));
112
+          set_lcd_error(GET_TEXT_F(MSG_PID_AUTOTUNE));
113 113
           break;
114 114
         case PID_BAD_EXTRUDER_NUM:
115
-          set_lcd_error_P(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
115
+          set_lcd_error(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM));
116 116
           break;
117 117
         case PID_TEMP_TOO_HIGH:
118
-          set_lcd_error_P(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
118
+          set_lcd_error(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH));
119 119
           break;
120 120
         case PID_TUNING_TIMEOUT:
121
-          set_lcd_error_P(GET_TEXT(MSG_PID_TIMEOUT));
121
+          set_lcd_error(GET_TEXT_F(MSG_PID_TIMEOUT));
122 122
           break;
123 123
         case PID_DONE:
124
-          set_lcd_error_P(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
124
+          set_lcd_error(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE));
125 125
           break;
126 126
       }
127 127
     }
128 128
 
129 129
   #endif
130 130
 
131
-  void onPrintTimerStarted() { write_to_lcd_P(PSTR("{SYS:BUILD}")); }
131
+  void onPrintTimerStarted() { write_to_lcd(F("{SYS:BUILD}")); }
132 132
   void onPrintTimerPaused() {}
133
-  void onPrintTimerStopped() { write_to_lcd_P(PSTR("{TQ:100}")); }
133
+  void onPrintTimerStopped() { write_to_lcd(F("{TQ:100}")); }
134 134
 
135 135
   // Not needed for Malyan LCD
136 136
   void onStatusChanged(const char * const) {}

+ 1
- 1
Marlin/src/lcd/extui/mks_ui/wifi_module.cpp View File

@@ -2030,7 +2030,7 @@ void get_wifi_commands() {
2030 2030
             wait_for_heatup = false;
2031 2031
             TERN_(HAS_LCD_MENU, wait_for_user = false);
2032 2032
           }
2033
-          if (strcmp(command, "M112") == 0) kill(M112_KILL_STR, nullptr, true);
2033
+          if (strcmp(command, "M112") == 0) kill(FPSTR(M112_KILL_STR), nullptr, true);
2034 2034
           if (strcmp(command, "M410") == 0) quickstop_stepper();
2035 2035
         #endif
2036 2036
 

+ 1
- 1
Marlin/src/lcd/extui/nextion/nextion_extui.cpp View File

@@ -37,7 +37,7 @@ namespace ExtUI {
37 37
 
38 38
   void onStartup()                                   { nextion.Startup();  }
39 39
   void onIdle()                                      { nextion.IdleLoop(); }
40
-  void onPrinterKilled(PGM_P const error, PGM_P const component) { nextion.PrinterKilled(error,component); }
40
+  void onPrinterKilled(FSTR_P const error, FSTR_P const component) { nextion.PrinterKilled(error, component); }
41 41
   void onMediaInserted() {}
42 42
   void onMediaError()    {}
43 43
   void onMediaRemoved()  {}

+ 5
- 5
Marlin/src/lcd/extui/nextion/nextion_tft.cpp View File

@@ -84,12 +84,12 @@ void NextionTFT::IdleLoop() {
84 84
   UpdateOnChange();
85 85
 }
86 86
 
87
-void NextionTFT::PrinterKilled(PGM_P error, PGM_P component) {
87
+void NextionTFT::PrinterKilled(FSTR_P const error, FSTR_P const component) {
88 88
   SEND_TXT_END("page error");
89
-  SEND_TXT("t3", "Error");
90
-  SEND_TXT_P("t4", component);
91
-  SEND_TXT_P("t5", error);
92
-  SEND_TXT("t6", "Need reset");
89
+  SEND_TXT_F("t3", F("Error"));
90
+  SEND_TXT_F("t4", component);
91
+  SEND_TXT_F("t5", error);
92
+  SEND_TXT_F("t6", F("Need reset"));
93 93
 }
94 94
 
95 95
 void NextionTFT::PrintFinished() {

+ 2
- 2
Marlin/src/lcd/extui/nextion/nextion_tft_defs.h View File

@@ -56,8 +56,8 @@
56 56
 
57 57
 #define SEND_TEMP(x,y,t,z)  (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), LCD_SERIAL.print(y), nextion.SendtoTFT(F(t)), LCD_SERIAL.print(z), nextion.SendtoTFT(F("\"\xFF\xFF\xFF")))
58 58
 #define SEND_VAL(x,y)       (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".val=")),   LCD_SERIAL.print(y), nextion.SendtoTFT(F("\xFF\xFF\xFF")))
59
-#define SEND_TXT(x,y)       (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), nextion.SendtoTFT(F(y)),  nextion.SendtoTFT(F("\"\xFF\xFF\xFF")))
60
-#define SEND_TXT_P(x,y)     (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), nextion.SendtoTFT(y), nextion.SendtoTFT(F("\"\xFF\xFF\xFF")))
59
+#define SEND_TXT(x,y)       (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), nextion.SendtoTFT(F(y)), nextion.SendtoTFT(F("\"\xFF\xFF\xFF")))
60
+#define SEND_TXT_F(x,y)     (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), nextion.SendtoTFT(y), nextion.SendtoTFT(F("\"\xFF\xFF\xFF")))
61 61
 #define SEND_VALasTXT(x,y)  (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), LCD_SERIAL.print(y), nextion.SendtoTFT(F("\"\xFF\xFF\xFF")))
62 62
 #define SEND_TXT_END(x)     (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F("\xFF\xFF\xFF")))
63 63
 #define SEND_PCO2(x,y,z)    (nextion.SendtoTFT(F(x)), LCD_SERIAL.print(y), nextion.SendtoTFT(F(".pco=")), nextion.SendtoTFT(F(z)), nextion.SendtoTFT(F("\xFF\xFF\xFF")))

+ 2
- 1
Marlin/src/lcd/extui/ui_api.cpp View File

@@ -1077,6 +1077,7 @@ namespace ExtUI {
1077 1077
   void resumePrint() { ui.resume_print(); }
1078 1078
   void stopPrint()   { ui.abort_print(); }
1079 1079
 
1080
+  // Simplest approach is to make an SRAM copy
1080 1081
   void onUserConfirmRequired(FSTR_P const fstr) {
1081 1082
     char msg[strlen_P(FTOP(fstr)) + 1];
1082 1083
     strcpy_P(msg, FTOP(fstr));
@@ -1153,7 +1154,7 @@ void MarlinUI::init() { ExtUI::onStartup(); }
1153 1154
 
1154 1155
 void MarlinUI::update() { ExtUI::onIdle(); }
1155 1156
 
1156
-void MarlinUI::kill_screen(PGM_P const error, PGM_P const component) {
1157
+void MarlinUI::kill_screen(FSTR_P const error, FSTR_P const component) {
1157 1158
   using namespace ExtUI;
1158 1159
   if (!flags.printer_killed) {
1159 1160
     flags.printer_killed = true;

+ 1
- 1
Marlin/src/lcd/extui/ui_api.h View File

@@ -394,7 +394,7 @@ namespace ExtUI {
394 394
   void onMediaError();
395 395
   void onMediaRemoved();
396 396
   void onPlayTone(const uint16_t frequency, const uint16_t duration);
397
-  void onPrinterKilled(PGM_P const error, PGM_P const component);
397
+  void onPrinterKilled(FSTR_P const error, FSTR_P const component);
398 398
   void onPrintTimerStarted();
399 399
   void onPrintTimerPaused();
400 400
   void onPrintTimerStopped();

+ 2
- 2
Marlin/src/lcd/marlinui.cpp View File

@@ -663,9 +663,9 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
663 663
     draw_status_screen();
664 664
   }
665 665
 
666
-  void MarlinUI::kill_screen(PGM_P lcd_error, PGM_P lcd_component) {
666
+  void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) {
667 667
     init();
668
-    status_printf(1, F(S_FMT ": " S_FMT), lcd_error, lcd_component);
668
+    status_printf(1, F(S_FMT ": " S_FMT), FTOP(lcd_error), FTOP(lcd_component));
669 669
     TERN_(HAS_LCD_MENU, return_to_status());
670 670
 
671 671
     // RED ALERT. RED ALERT.

+ 2
- 2
Marlin/src/lcd/marlinui.h View File

@@ -356,9 +356,9 @@ public:
356 356
   static void status_printf(const uint8_t level, FSTR_P const fmt, ...);
357 357
 
358 358
   #if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED)
359
-    static void kill_screen(PGM_P const lcd_error, PGM_P const lcd_component);
359
+    static void kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component);
360 360
   #else
361
-    static inline void kill_screen(PGM_P const, PGM_P const) {}
361
+    static inline void kill_screen(FSTR_P const, FSTR_P const) {}
362 362
   #endif
363 363
 
364 364
   #if HAS_DISPLAY

+ 1
- 1
Marlin/src/module/endstops.cpp View File

@@ -384,7 +384,7 @@ void Endstops::not_homing() {
384 384
   // If the last move failed to trigger an endstop, call kill
385 385
   void Endstops::validate_homing_move() {
386 386
     if (trigger_state()) hit_on_purpose();
387
-    else kill(GET_TEXT(MSG_KILL_HOMING_FAILED));
387
+    else kill(GET_TEXT_F(MSG_KILL_HOMING_FAILED));
388 388
   }
389 389
 #endif
390 390
 

+ 1
- 1
Marlin/src/module/motion.cpp View File

@@ -1829,7 +1829,7 @@ void prepare_line_to_destination() {
1829 1829
         }
1830 1830
         if (TEST(endstops.state(), es)) {
1831 1831
           SERIAL_ECHO_MSG("Bad ", AS_CHAR(AXIS_CHAR(axis)), " Endstop?");
1832
-          kill(GET_TEXT(MSG_KILL_HOMING_FAILED));
1832
+          kill(GET_TEXT_F(MSG_KILL_HOMING_FAILED));
1833 1833
         }
1834 1834
       #endif
1835 1835
 

+ 1
- 1
Marlin/src/module/planner.cpp View File

@@ -3036,7 +3036,7 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s, cons
3036 3036
 
3037 3037
   void Planner::buffer_page(const page_idx_t page_idx, const uint8_t extruder, const uint16_t num_steps) {
3038 3038
     if (!last_page_step_rate) {
3039
-      kill(GET_TEXT(MSG_BAD_PAGE_SPEED));
3039
+      kill(GET_TEXT_F(MSG_BAD_PAGE_SPEED));
3040 3040
       return;
3041 3041
     }
3042 3042
 

+ 1
- 1
Marlin/src/module/probe.cpp View File

@@ -297,7 +297,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
297 297
 
298 298
       TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR)));
299 299
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Stow Probe")));
300
-      TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, PSTR("Stow Probe"), CONTINUE_STR));
300
+      TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, F("Stow Probe"), FPSTR(CONTINUE_STR)));
301 301
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
302 302
       ui.reset_status();
303 303
 

+ 26
- 26
Marlin/src/module/temperature.cpp View File

@@ -187,8 +187,8 @@
187 187
 
188 188
 Temperature thermalManager;
189 189
 
190
-const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
191
-           str_t_heating_failed[] PROGMEM = STR_T_HEATING_FAILED;
190
+PGMSTR(str_t_thermal_runaway, STR_T_THERMAL_RUNAWAY);
191
+PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
192 192
 
193 193
 /**
194 194
  * Macros to include the heater id in temp errors. The compiler's dead-code
@@ -196,22 +196,22 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
196 196
  */
197 197
 
198 198
 #if HAS_HEATED_BED
199
-  #define _BED_PSTR(h) (h) == H_BED ? GET_TEXT(MSG_BED) :
199
+  #define _BED_FSTR(h) (h) == H_BED ? GET_TEXT_F(MSG_BED) :
200 200
 #else
201
-  #define _BED_PSTR(h)
201
+  #define _BED_FSTR(h)
202 202
 #endif
203 203
 #if HAS_HEATED_CHAMBER
204
-  #define _CHAMBER_PSTR(h) (h) == H_CHAMBER ? GET_TEXT(MSG_CHAMBER) :
204
+  #define _CHAMBER_FSTR(h) (h) == H_CHAMBER ? GET_TEXT_F(MSG_CHAMBER) :
205 205
 #else
206
-  #define _CHAMBER_PSTR(h)
206
+  #define _CHAMBER_FSTR(h)
207 207
 #endif
208 208
 #if HAS_COOLER
209
-  #define _COOLER_PSTR(h) (h) == H_COOLER ? GET_TEXT(MSG_COOLER) :
209
+  #define _COOLER_FSTR(h) (h) == H_COOLER ? GET_TEXT_F(MSG_COOLER) :
210 210
 #else
211
-  #define _COOLER_PSTR(h)
211
+  #define _COOLER_FSTR(h)
212 212
 #endif
213
-#define _E_PSTR(h,N) ((HOTENDS) > N && (h) == N) ? PSTR(LCD_STR_E##N) :
214
-#define HEATER_PSTR(h) _BED_PSTR(h) _CHAMBER_PSTR(h) _COOLER_PSTR(h) _E_PSTR(h,1) _E_PSTR(h,2) _E_PSTR(h,3) _E_PSTR(h,4) _E_PSTR(h,5) PSTR(LCD_STR_E0)
213
+#define _E_FSTR(h,N) ((HOTENDS) > N && (h) == N) ? F(LCD_STR_E##N) :
214
+#define HEATER_FSTR(h) _BED_FSTR(h) _CHAMBER_FSTR(h) _COOLER_FSTR(h) _E_FSTR(h,1) _E_FSTR(h,2) _E_FSTR(h,3) _E_FSTR(h,4) _E_FSTR(h,5) F(LCD_STR_E0)
215 215
 
216 216
 //
217 217
 // Initialize MAX TC objects/SPI
@@ -731,10 +731,10 @@ volatile bool Temperature::raw_temps_ready = false;
731 731
                 if (current_temp > watch_temp_target) heated = true;  // - Flag if target temperature reached
732 732
               }
733 733
               else if (ELAPSED(ms, temp_change_ms))                   // Watch timer expired
734
-                _temp_error(heater_id, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
734
+                _temp_error(heater_id, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
735 735
             }
736 736
             else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far?
737
-              _temp_error(heater_id, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY));
737
+              _temp_error(heater_id, FPSTR(str_t_thermal_runaway), GET_TEXT_F(MSG_THERMAL_RUNAWAY));
738 738
           }
739 739
         #endif
740 740
       } // every 2 seconds
@@ -951,7 +951,7 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
951 951
 // Temperature Error Handlers
952 952
 //
953 953
 
954
-inline void loud_kill(PGM_P const lcd_msg, const heater_id_t heater_id) {
954
+inline void loud_kill(FSTR_P const lcd_msg, const heater_id_t heater_id) {
955 955
   marlin_state = MF_KILLED;
956 956
   #if USE_BEEPER
957 957
     thermalManager.disable_all_heaters();
@@ -967,16 +967,16 @@ inline void loud_kill(PGM_P const lcd_msg, const heater_id_t heater_id) {
967 967
     }
968 968
     WRITE(BEEPER_PIN, HIGH);
969 969
   #endif
970
-  kill(lcd_msg, HEATER_PSTR(heater_id));
970
+  kill(lcd_msg, HEATER_FSTR(heater_id));
971 971
 }
972 972
 
973
-void Temperature::_temp_error(const heater_id_t heater_id, PGM_P const serial_msg, PGM_P const lcd_msg) {
973
+void Temperature::_temp_error(const heater_id_t heater_id, FSTR_P const serial_msg, FSTR_P const lcd_msg) {
974 974
 
975 975
   static uint8_t killed = 0;
976 976
 
977 977
   if (IsRunning() && TERN1(BOGUS_TEMPERATURE_GRACE_PERIOD, killed == 2)) {
978 978
     SERIAL_ERROR_START();
979
-    SERIAL_ECHOPGM_P(serial_msg);
979
+    SERIAL_ECHOF(serial_msg);
980 980
     SERIAL_ECHOPGM(STR_STOPPED_HEATER);
981 981
 
982 982
     heater_id_t real_heater_id = heater_id;
@@ -1031,14 +1031,14 @@ void Temperature::max_temp_error(const heater_id_t heater_id) {
1031 1031
   #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED)
1032 1032
     DWIN_Popup_Temperature(1);
1033 1033
   #endif
1034
-  _temp_error(heater_id, PSTR(STR_T_MAXTEMP), GET_TEXT(MSG_ERR_MAXTEMP));
1034
+  _temp_error(heater_id, F(STR_T_MAXTEMP), GET_TEXT_F(MSG_ERR_MAXTEMP));
1035 1035
 }
1036 1036
 
1037 1037
 void Temperature::min_temp_error(const heater_id_t heater_id) {
1038 1038
   #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED)
1039 1039
     DWIN_Popup_Temperature(0);
1040 1040
   #endif
1041
-  _temp_error(heater_id, PSTR(STR_T_MINTEMP), GET_TEXT(MSG_ERR_MINTEMP));
1041
+  _temp_error(heater_id, F(STR_T_MINTEMP), GET_TEXT_F(MSG_ERR_MINTEMP));
1042 1042
 }
1043 1043
 
1044 1044
 #if ANY(PID_DEBUG, PID_BED_DEBUG, PID_CHAMBER_DEBUG)
@@ -1294,7 +1294,7 @@ void Temperature::manage_heater() {
1294 1294
   REMEMBER(mh, no_reentry, true);
1295 1295
 
1296 1296
   #if ENABLED(EMERGENCY_PARSER)
1297
-    if (emergency_parser.killed_by_M112) kill(M112_KILL_STR, nullptr, true);
1297
+    if (emergency_parser.killed_by_M112) kill(FPSTR(M112_KILL_STR), nullptr, true);
1298 1298
 
1299 1299
     if (emergency_parser.quickstop_by_M410) {
1300 1300
       emergency_parser.quickstop_by_M410 = false; // quickstop_stepper may call idle so clear this now!
@@ -1344,7 +1344,7 @@ void Temperature::manage_heater() {
1344 1344
             start_watching_hotend(e);               // If temp reached, turn off elapsed check
1345 1345
           else {
1346 1346
             TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0));
1347
-            _temp_error((heater_id_t)e, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
1347
+            _temp_error((heater_id_t)e, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
1348 1348
           }
1349 1349
         }
1350 1350
       #endif
@@ -1356,7 +1356,7 @@ void Temperature::manage_heater() {
1356 1356
   #if HAS_TEMP_REDUNDANT
1357 1357
     // Make sure measured temperatures are close together
1358 1358
     if (ABS(degRedundantTarget() - degRedundant()) > TEMP_SENSOR_REDUNDANT_MAX_DIFF)
1359
-      _temp_error((heater_id_t)HEATER_ID(TEMP_SENSOR_REDUNDANT_TARGET), PSTR(STR_REDUNDANCY), GET_TEXT(MSG_ERR_REDUNDANT_TEMP));
1359
+      _temp_error((heater_id_t)HEATER_ID(TEMP_SENSOR_REDUNDANT_TARGET), F(STR_REDUNDANCY), GET_TEXT_F(MSG_ERR_REDUNDANT_TEMP));
1360 1360
   #endif
1361 1361
 
1362 1362
   #if HAS_AUTO_FAN
@@ -1387,7 +1387,7 @@ void Temperature::manage_heater() {
1387 1387
           start_watching_bed();                 // If temp reached, turn off elapsed check
1388 1388
         else {
1389 1389
           TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0));
1390
-          _temp_error(H_BED, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
1390
+          _temp_error(H_BED, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
1391 1391
         }
1392 1392
       }
1393 1393
     #endif // WATCH_BED
@@ -1467,7 +1467,7 @@ void Temperature::manage_heater() {
1467 1467
         if (watch_chamber.check(degChamber()))  // Increased enough? Error below.
1468 1468
           start_watching_chamber();             // If temp reached, turn off elapsed check.
1469 1469
         else
1470
-          _temp_error(H_CHAMBER, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
1470
+          _temp_error(H_CHAMBER, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
1471 1471
       }
1472 1472
     #endif
1473 1473
 
@@ -1589,7 +1589,7 @@ void Temperature::manage_heater() {
1589 1589
       // Make sure temperature is decreasing
1590 1590
       if (watch_cooler.elapsed(ms)) {             // Time to check the cooler?
1591 1591
         if (degCooler() > watch_cooler.target)    // Failed to decrease enough?
1592
-          _temp_error(H_COOLER, GET_TEXT(MSG_COOLING_FAILED), GET_TEXT(MSG_COOLING_FAILED));
1592
+          _temp_error(H_COOLER, GET_TEXT_F(MSG_COOLING_FAILED), GET_TEXT_F(MSG_COOLING_FAILED));
1593 1593
         else
1594 1594
           start_watching_cooler();                 // Start again if the target is still far off
1595 1595
       }
@@ -2597,7 +2597,7 @@ void Temperature::init() {
2597 2597
 
2598 2598
       case TRRunaway:
2599 2599
         TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0));
2600
-        _temp_error(heater_id, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY));
2600
+        _temp_error(heater_id, FPSTR(str_t_thermal_runaway), GET_TEXT_F(MSG_THERMAL_RUNAWAY));
2601 2601
     }
2602 2602
   }
2603 2603
 
@@ -3896,7 +3896,7 @@ void Temperature::isr() {
3896 3896
       const bool wants_to_cool = isProbeAboveTemp(target_temp),
3897 3897
                  will_wait = !(wants_to_cool && no_wait_for_cooling);
3898 3898
       if (will_wait)
3899
-        SERIAL_ECHOLNPGM("Waiting for probe to ", (wants_to_cool ? PSTR("cool down") : PSTR("heat up")), " to ", target_temp, " degrees.");
3899
+        SERIAL_ECHOLNPGM("Waiting for probe to ", wants_to_cool ? F("cool down") : F("heat up"), " to ", target_temp, " degrees.");
3900 3900
 
3901 3901
       #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
3902 3902
         KEEPALIVE_STATE(NOT_BUSY);

+ 1
- 1
Marlin/src/module/temperature.h View File

@@ -961,7 +961,7 @@ class Temperature {
961 961
       static float get_pid_output_chamber();
962 962
     #endif
963 963
 
964
-    static void _temp_error(const heater_id_t e, PGM_P const serial_msg, PGM_P const lcd_msg);
964
+    static void _temp_error(const heater_id_t e, FSTR_P const serial_msg, FSTR_P const lcd_msg);
965 965
     static void min_temp_error(const heater_id_t e);
966 966
     static void max_temp_error(const heater_id_t e);
967 967
 

+ 1
- 1
Marlin/src/module/tool_change.cpp View File

@@ -432,7 +432,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
432 432
         }
433 433
         else if (kill_on_error && (!tool_sensor_disabled || disable)) {
434 434
           sensor_tries++;
435
-          if (sensor_tries > 10) kill(PSTR("Tool Sensor error"));
435
+          if (sensor_tries > 10) kill(F("Tool Sensor error"));
436 436
           safe_delay(5);
437 437
         }
438 438
         else {

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

@@ -646,7 +646,7 @@ void CardReader::openFileRead(const char * const path, const uint8_t subcall_typ
646 646
         // Too deep? The firmware has to bail.
647 647
         if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
648 648
           SERIAL_ERROR_MSG("Exceeded max SUBROUTINE depth:", SD_PROCEDURE_DEPTH);
649
-          kill(GET_TEXT(MSG_KILL_SUBCALL_OVERFLOW));
649
+          kill(GET_TEXT_F(MSG_KILL_SUBCALL_OVERFLOW));
650 650
           return;
651 651
         }
652 652
 

Loading…
Cancel
Save