Kaynağa Gözat

🎨 Apply F() to Host Actions strings

Scott Lahteine 2 yıl önce
ebeveyn
işleme
008bf1bcae

+ 32
- 32
Marlin/src/feature/host_actions.cpp Dosyayı Görüntüle

@@ -37,33 +37,33 @@
37 37
   #include "runout.h"
38 38
 #endif
39 39
 
40
-void host_action(PGM_P const pstr, const bool eol) {
40
+void host_action(FSTR_P const fstr, const bool eol) {
41 41
   PORT_REDIRECT(SerialMask::All);
42 42
   SERIAL_ECHOPGM("//action:");
43
-  SERIAL_ECHOPGM_P(pstr);
43
+  SERIAL_ECHOF(fstr);
44 44
   if (eol) SERIAL_EOL();
45 45
 }
46 46
 
47 47
 #ifdef ACTION_ON_KILL
48
-  void host_action_kill() { host_action(PSTR(ACTION_ON_KILL)); }
48
+  void host_action_kill() { host_action(F(ACTION_ON_KILL)); }
49 49
 #endif
50 50
 #ifdef ACTION_ON_PAUSE
51
-  void host_action_pause(const bool eol/*=true*/) { host_action(PSTR(ACTION_ON_PAUSE), eol); }
51
+  void host_action_pause(const bool eol/*=true*/) { host_action(F(ACTION_ON_PAUSE), eol); }
52 52
 #endif
53 53
 #ifdef ACTION_ON_PAUSED
54
-  void host_action_paused(const bool eol/*=true*/) { host_action(PSTR(ACTION_ON_PAUSED), eol); }
54
+  void host_action_paused(const bool eol/*=true*/) { host_action(F(ACTION_ON_PAUSED), eol); }
55 55
 #endif
56 56
 #ifdef ACTION_ON_RESUME
57
-  void host_action_resume() { host_action(PSTR(ACTION_ON_RESUME)); }
57
+  void host_action_resume() { host_action(F(ACTION_ON_RESUME)); }
58 58
 #endif
59 59
 #ifdef ACTION_ON_RESUMED
60
-  void host_action_resumed() { host_action(PSTR(ACTION_ON_RESUMED)); }
60
+  void host_action_resumed() { host_action(F(ACTION_ON_RESUMED)); }
61 61
 #endif
62 62
 #ifdef ACTION_ON_CANCEL
63
-  void host_action_cancel() { host_action(PSTR(ACTION_ON_CANCEL)); }
63
+  void host_action_cancel() { host_action(F(ACTION_ON_CANCEL)); }
64 64
 #endif
65 65
 #ifdef ACTION_ON_START
66
-  void host_action_start() { host_action(PSTR(ACTION_ON_START)); }
66
+  void host_action_start() { host_action(F(ACTION_ON_START)); }
67 67
 #endif
68 68
 
69 69
 #if ENABLED(HOST_PROMPT_SUPPORT)
@@ -77,60 +77,60 @@ void host_action(PGM_P const pstr, const bool eol) {
77 77
 
78 78
   PromptReason host_prompt_reason = PROMPT_NOT_DEFINED;
79 79
 
80
-  void host_action_notify(const char * const message) {
80
+  void host_action_notify(const char * const cstr) {
81 81
     PORT_REDIRECT(SerialMask::All);
82
-    host_action(PSTR("notification "), false);
83
-    SERIAL_ECHOLN(message);
82
+    host_action(F("notification "), false);
83
+    SERIAL_ECHOLN(cstr);
84 84
   }
85 85
 
86
-  void host_action_notify_P(PGM_P const message) {
86
+  void host_action_notify(FSTR_P const fstr) {
87 87
     PORT_REDIRECT(SerialMask::All);
88
-    host_action(PSTR("notification "), false);
89
-    SERIAL_ECHOLNPGM_P(message);
88
+    host_action(F("notification "), false);
89
+    SERIAL_ECHOLNF(fstr);
90 90
   }
91 91
 
92
-  void host_action_prompt(PGM_P const ptype, const bool eol=true) {
92
+  void host_action_prompt(FSTR_P const ptype, const bool eol=true) {
93 93
     PORT_REDIRECT(SerialMask::All);
94
-    host_action(PSTR("prompt_"), false);
95
-    SERIAL_ECHOPGM_P(ptype);
94
+    host_action(F("prompt_"), false);
95
+    SERIAL_ECHOF(ptype);
96 96
     if (eol) SERIAL_EOL();
97 97
   }
98 98
 
99
-  void host_action_prompt_plus(PGM_P const ptype, PGM_P const pstr, const char extra_char='\0') {
99
+  void host_action_prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0') {
100 100
     host_action_prompt(ptype, false);
101 101
     PORT_REDIRECT(SerialMask::All);
102 102
     SERIAL_CHAR(' ');
103
-    SERIAL_ECHOPGM_P(pstr);
103
+    SERIAL_ECHOF(fstr);
104 104
     if (extra_char != '\0') SERIAL_CHAR(extra_char);
105 105
     SERIAL_EOL();
106 106
   }
107
-  void host_action_prompt_begin(const PromptReason reason, PGM_P const pstr, const char extra_char/*='\0'*/) {
107
+  void host_action_prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
108 108
     host_action_prompt_end();
109 109
     host_prompt_reason = reason;
110
-    host_action_prompt_plus(PSTR("begin"), pstr, extra_char);
110
+    host_action_prompt_plus(F("begin"), fstr, extra_char);
111 111
   }
112
-  void host_action_prompt_button(PGM_P const pstr) { host_action_prompt_plus(PSTR("button"), pstr); }
113
-  void host_action_prompt_end() { host_action_prompt(PSTR("end")); }
114
-  void host_action_prompt_show() { host_action_prompt(PSTR("show")); }
112
+  void host_action_prompt_button(FSTR_P const fstr) { host_action_prompt_plus(F("button"), fstr); }
113
+  void host_action_prompt_end() { host_action_prompt(F("end")); }
114
+  void host_action_prompt_show() { host_action_prompt(F("show")); }
115 115
 
116
-  void _host_prompt_show(PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) {
116
+  void _host_prompt_show(FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
117 117
     if (btn1) host_action_prompt_button(btn1);
118 118
     if (btn2) host_action_prompt_button(btn2);
119 119
     host_action_prompt_show();
120 120
   }
121
-  void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) {
122
-    host_action_prompt_begin(reason, pstr);
121
+  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
122
+    host_action_prompt_begin(reason, fstr);
123 123
     _host_prompt_show(btn1, btn2);
124 124
   }
125
-  void host_prompt_do(const PromptReason reason, PGM_P const pstr, const char extra_char, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) {
126
-    host_action_prompt_begin(reason, pstr, extra_char);
125
+  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
126
+    host_action_prompt_begin(reason, fstr, extra_char);
127 127
     _host_prompt_show(btn1, btn2);
128 128
   }
129 129
 
130 130
   void filament_load_host_prompt() {
131 131
     const bool disable_to_continue = TERN0(HAS_FILAMENT_SENSOR, runout.filament_ran_out);
132
-    host_prompt_do(PROMPT_FILAMENT_RUNOUT, PSTR("Paused"), PSTR("PurgeMore"),
133
-      disable_to_continue ? PSTR("DisableRunout") : CONTINUE_STR
132
+    host_prompt_do(PROMPT_FILAMENT_RUNOUT, F("Paused"), F("PurgeMore"),
133
+      disable_to_continue ? F("DisableRunout") : FPSTR(CONTINUE_STR)
134 134
     );
135 135
   }
136 136
 

+ 9
- 9
Marlin/src/feature/host_actions.h Dosyayı Görüntüle

@@ -24,7 +24,7 @@
24 24
 #include "../inc/MarlinConfigPre.h"
25 25
 #include "../HAL/shared/Marduino.h"
26 26
 
27
-void host_action(PGM_P const pstr, const bool eol=true);
27
+void host_action(FSTR_P const fstr, const bool eol=true);
28 28
 
29 29
 #ifdef ACTION_ON_KILL
30 30
   void host_action_kill();
@@ -64,16 +64,16 @@ void host_action(PGM_P const pstr, const bool eol=true);
64 64
   extern PromptReason host_prompt_reason;
65 65
 
66 66
   void host_response_handler(const uint8_t response);
67
-  void host_action_notify(const char * const message);
68
-  void host_action_notify_P(PGM_P const message);
69
-  void host_action_prompt_begin(const PromptReason reason, PGM_P const pstr, const char extra_char='\0');
70
-  void host_action_prompt_button(PGM_P const pstr);
67
+  void host_action_notify(const char * const cstr);
68
+  void host_action_notify(FSTR_P const fstr);
69
+  void host_action_prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
70
+  void host_action_prompt_button(FSTR_P const fstr);
71 71
   void host_action_prompt_end();
72 72
   void host_action_prompt_show();
73
-  void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr);
74
-  void host_prompt_do(const PromptReason reason, PGM_P const pstr, const char extra_char, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr);
75
-  inline void host_prompt_open(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr) {
76
-    if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, btn1, btn2);
73
+  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
74
+  void host_prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
75
+  inline void host_prompt_open(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
76
+    if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, fstr, btn1, btn2);
77 77
   }
78 78
 
79 79
   void filament_load_host_prompt();

+ 1
- 1
Marlin/src/feature/mmu/mmu2.cpp Dosyayı Görüntüle

@@ -960,7 +960,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
960 960
   if (recover)  {
961 961
     LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
962 962
     BUZZ(200, 404);
963
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR));
963
+    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
964 964
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover")));
965 965
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
966 966
     BUZZ(200, 404);

+ 8
- 8
Marlin/src/feature/pause.cpp Dosyayı Görüntüle

@@ -198,7 +198,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
198 198
 
199 199
     #if ENABLED(HOST_PROMPT_SUPPORT)
200 200
       const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder);
201
-      host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Load Filament T"), tool, CONTINUE_STR);
201
+      host_prompt_do(PROMPT_USER_CONTINUE, F("Load Filament T"), tool, FPSTR(CONTINUE_STR));
202 202
     #endif
203 203
 
204 204
     while (wait_for_user) {
@@ -253,7 +253,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
253 253
     if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
254 254
 
255 255
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE)));
256
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_FILAMENT_CHANGE_PURGE), CONTINUE_STR));
256
+    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
257 257
     TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT(MSG_FILAMENT_CHANGE_PURGE), 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)
@@ -403,7 +403,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
403 403
     #endif
404 404
   #endif
405 405
 
406
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("Pause"), DISMISS_STR));
406
+  TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR)));
407 407
 
408 408
   // Indicate that the printer is paused
409 409
   ++did_pause_print;
@@ -512,7 +512,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
512 512
 
513 513
   // Wait for filament insert by user and press button
514 514
   KEEPALIVE_STATE(PAUSED_FOR_USER);
515
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_NOZZLE_PARKED), CONTINUE_STR));
515
+  TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_NOZZLE_PARKED), FPSTR(CONTINUE_STR)));
516 516
   TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_NOZZLE_PARKED)));
517 517
   wait_for_user = true;    // LCD click or M108 will clear this
518 518
   while (wait_for_user) {
@@ -528,13 +528,13 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
528 528
       ui.pause_show_message(PAUSE_MESSAGE_HEAT);
529 529
       SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT));
530 530
 
531
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_HEATER_TIMEOUT), GET_TEXT(MSG_REHEAT)));
531
+      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
532 532
 
533 533
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_HEATER_TIMEOUT)));
534 534
 
535 535
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(0, true)); // Wait for LCD click or M108
536 536
 
537
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, GET_TEXT(MSG_REHEATING)));
537
+      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING)));
538 538
 
539 539
       TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged_P(GET_TEXT(MSG_REHEATING)));
540 540
 
@@ -554,7 +554,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
554 554
 
555 555
       HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout);
556 556
 
557
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_REHEATDONE), CONTINUE_STR));
557
+      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR)));
558 558
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_REHEATDONE)));
559 559
       TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATDONE));
560 560
 
@@ -671,7 +671,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
671 671
 
672 672
   --did_pause_print;
673 673
 
674
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("Resuming"), DISMISS_STR));
674
+  TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Resuming"), FPSTR(DISMISS_STR)));
675 675
 
676 676
   // Resume the print job timer if it was running
677 677
   if (print_job_timer.isPaused()) print_job_timer.start();

+ 2
- 2
Marlin/src/feature/runout.cpp Dosyayı Görüntüle

@@ -96,7 +96,7 @@ void event_filament_runout(const uint8_t extruder) {
96 96
 
97 97
   //action:out_of_filament
98 98
   #if ENABLED(HOST_PROMPT_SUPPORT)
99
-    host_action_prompt_begin(PROMPT_FILAMENT_RUNOUT, PSTR("FilamentRunout T"), tool);
99
+    host_action_prompt_begin(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool);
100 100
     host_action_prompt_show();
101 101
   #endif
102 102
 
@@ -115,7 +115,7 @@ void event_filament_runout(const uint8_t extruder) {
115 115
       // Legacy Repetier command for use until newer version supports standard dialog
116 116
       // To be removed later when pause command also triggers dialog
117 117
       #ifdef ACTION_ON_FILAMENT_RUNOUT
118
-        host_action(PSTR(ACTION_ON_FILAMENT_RUNOUT " T"), false);
118
+        host_action(F(ACTION_ON_FILAMENT_RUNOUT " T"), false);
119 119
         SERIAL_CHAR(tool);
120 120
         SERIAL_EOL();
121 121
       #endif

+ 1
- 1
Marlin/src/gcode/config/M43.cpp Dosyayı Görüntüle

@@ -344,7 +344,7 @@ void GcodeSuite::M43() {
344 344
     #if HAS_RESUME_CONTINUE
345 345
       KEEPALIVE_STATE(PAUSED_FOR_USER);
346 346
       wait_for_user = true;
347
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), CONTINUE_STR));
347
+      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("M43 Wait Called"), FPSTR(CONTINUE_STR)));
348 348
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("M43 Wait Called")));
349 349
     #endif
350 350
 

+ 3
- 3
Marlin/src/gcode/gcode.cpp Dosyayı Görüntüle

@@ -237,9 +237,9 @@ void GcodeSuite::dwell(millis_t time) {
237 237
 #if ENABLED(G29_RETRY_AND_RECOVER)
238 238
 
239 239
   void GcodeSuite::event_probe_recover() {
240
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), DISMISS_STR));
240
+    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, F("G29 Retrying"), FPSTR(DISMISS_STR)));
241 241
     #ifdef ACTION_ON_G29_RECOVER
242
-      host_action(PSTR(ACTION_ON_G29_RECOVER));
242
+      host_action(F(ACTION_ON_G29_RECOVER));
243 243
     #endif
244 244
     #ifdef G29_RECOVER_COMMANDS
245 245
       process_subcommands_now(F(G29_RECOVER_COMMANDS));
@@ -252,7 +252,7 @@ void GcodeSuite::dwell(millis_t time) {
252 252
 
253 253
   void GcodeSuite::event_probe_failure() {
254 254
     #ifdef ACTION_ON_G29_FAILURE
255
-      host_action(PSTR(ACTION_ON_G29_FAILURE));
255
+      host_action(F(ACTION_ON_G29_FAILURE));
256 256
     #endif
257 257
     #ifdef G29_FAILURE_COMMANDS
258 258
       process_subcommands_now(F(G29_FAILURE_COMMANDS));

+ 1
- 1
Marlin/src/gcode/lcd/M0_M1.cpp Dosyayı Görüntüle

@@ -84,7 +84,7 @@ void GcodeSuite::M0_M1() {
84 84
 
85 85
   #endif
86 86
 
87
-  TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR));
87
+  TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR)));
88 88
 
89 89
   TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
90 90
 

+ 1
- 1
Marlin/src/gcode/sd/M1001.cpp Dosyayı Görüntüle

@@ -96,7 +96,7 @@ void GcodeSuite::M1001() {
96 96
     if (long_print) {
97 97
       printerEventLEDs.onPrintCompleted();
98 98
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_PRINT_DONE)));
99
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_PRINT_DONE), CONTINUE_STR));
99
+      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR)));
100 100
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30))));
101 101
       printerEventLEDs.onResumeAfterWait();
102 102
     }

+ 2
- 2
Marlin/src/gcode/sd/M24_M25.cpp Dosyayı Görüntüle

@@ -79,7 +79,7 @@ void GcodeSuite::M24() {
79 79
     #ifdef ACTION_ON_RESUME
80 80
       host_action_resume();
81 81
     #endif
82
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("Resuming SD"), DISMISS_STR));
82
+    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Resuming SD"), FPSTR(DISMISS_STR)));
83 83
   #endif
84 84
 
85 85
   ui.reset_status();
@@ -116,7 +116,7 @@ void GcodeSuite::M25() {
116 116
     IF_DISABLED(DWIN_CREALITY_LCD, ui.reset_status());
117 117
 
118 118
     #if ENABLED(HOST_ACTION_COMMANDS)
119
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("Pause SD"), PSTR("Resume")));
119
+      TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, F("Pause SD"), F("Resume")));
120 120
       #ifdef ACTION_ON_PAUSE
121 121
         host_action_pause();
122 122
       #endif

+ 11
- 11
Marlin/src/lcd/marlinui.cpp Dosyayı Görüntüle

@@ -1352,28 +1352,28 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1352 1352
 
1353 1353
   bool MarlinUI::has_status() { return (status_message[0] != '\0'); }
1354 1354
 
1355
-  void MarlinUI::set_status(const char * const message, const bool persist) {
1355
+  void MarlinUI::set_status(const char * const cstr, const bool persist) {
1356 1356
     if (alert_level) return;
1357 1357
 
1358
-    TERN_(HOST_PROMPT_SUPPORT, host_action_notify(message));
1358
+    TERN_(HOST_PROMPT_SUPPORT, host_action_notify(cstr));
1359 1359
 
1360 1360
     // Here we have a problem. The message is encoded in UTF8, so
1361 1361
     // arbitrarily cutting it will be a problem. We MUST be sure
1362 1362
     // that there is no cutting in the middle of a multibyte character!
1363 1363
 
1364 1364
     // Get a pointer to the null terminator
1365
-    const char* pend = message + strlen(message);
1365
+    const char* pend = cstr + strlen(cstr);
1366 1366
 
1367 1367
     //  If length of supplied UTF8 string is greater than
1368 1368
     // our buffer size, start cutting whole UTF8 chars
1369
-    while ((pend - message) > MAX_MESSAGE_LENGTH) {
1369
+    while ((pend - cstr) > MAX_MESSAGE_LENGTH) {
1370 1370
       --pend;
1371 1371
       while (!START_OF_UTF8_CHAR(*pend)) --pend;
1372 1372
     };
1373 1373
 
1374 1374
     // At this point, we have the proper cut point. Use it
1375
-    uint8_t maxLen = pend - message;
1376
-    strncpy(status_message, message, maxLen);
1375
+    uint8_t maxLen = pend - cstr;
1376
+    strncpy(status_message, cstr, maxLen);
1377 1377
     status_message[maxLen] = '\0';
1378 1378
 
1379 1379
     finish_status(persist);
@@ -1427,7 +1427,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1427 1427
     if (level < alert_level) return;
1428 1428
     alert_level = level;
1429 1429
 
1430
-    TERN_(HOST_PROMPT_SUPPORT, host_action_notify_P(pstr));
1430
+    TERN_(HOST_PROMPT_SUPPORT, host_action_notify(fstr));
1431 1431
 
1432 1432
     // Since the message is encoded in UTF8 it must
1433 1433
     // only be cut on a character boundary.
@@ -1536,7 +1536,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1536 1536
       host_action_cancel();
1537 1537
     #endif
1538 1538
     IF_DISABLED(SDSUPPORT, print_job_timer.stop());
1539
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), DISMISS_STR));
1539
+    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("UI Aborted"), FPSTR(DISMISS_STR)));
1540 1540
     LCD_MESSAGE(MSG_PRINT_ABORTED);
1541 1541
     TERN_(HAS_LCD_MENU, return_to_status());
1542 1542
   }
@@ -1565,7 +1565,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1565 1565
     #endif
1566 1566
 
1567 1567
     TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
1568
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume")));
1568
+    TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, F("UI Pause"), F("Resume")));
1569 1569
 
1570 1570
     LCD_MESSAGE(MSG_PRINT_PAUSED);
1571 1571
 
@@ -1642,10 +1642,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1642 1642
     TERN(HOST_PROMPT_SUPPORT, host_action_notify(cstr), UNUSED(cstr));
1643 1643
   }
1644 1644
   void MarlinUI::set_status(FSTR_P const fstr, const int8_t) {
1645
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(FTOP(fstr)), UNUSED(fstr));
1645
+    TERN(HOST_PROMPT_SUPPORT, host_action_notify(fstr), UNUSED(fstr));
1646 1646
   }
1647 1647
   void MarlinUI::status_printf(const uint8_t, FSTR_P const fstr, ...) {
1648
-    TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(FPSTR(fstr)), UNUSED(fstr));
1648
+    TERN(HOST_PROMPT_SUPPORT, host_action_notify(fstr), UNUSED(fstr));
1649 1649
   }
1650 1650
 
1651 1651
 #endif // !HAS_DISPLAY && !HAS_STATUS_MESSAGE

+ 1
- 1
Marlin/src/lcd/menu/menu_delta_calibrate.cpp Dosyayı Görüntüle

@@ -64,7 +64,7 @@ void _man_probe_pt(const xy_pos_t &xy) {
64 64
   float lcd_probe_pt(const xy_pos_t &xy) {
65 65
     _man_probe_pt(xy);
66 66
     ui.defer_status_screen();
67
-    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR));
67
+    TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Delta Calibration in progress"), FPSTR(CONTINUE_STR)));
68 68
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress")));
69 69
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
70 70
     ui.goto_previous_screen_no_defer();

+ 2
- 2
Marlin/src/module/probe.cpp Dosyayı Görüntüle

@@ -140,7 +140,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
140 140
       LCD_MESSAGE(MSG_MANUAL_DEPLOY_TOUCHMI);
141 141
       ui.return_to_status();
142 142
 
143
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI"), CONTINUE_STR));
143
+      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Deploy TouchMI"), FPSTR(CONTINUE_STR)));
144 144
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
145 145
       ui.reset_status();
146 146
       ui.goto_screen(prev_screen);
@@ -295,7 +295,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
295 295
       ui.set_status(ds_str, 99);
296 296
       SERIAL_ECHOLNF(ds_str);
297 297
 
298
-      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR));
298
+      TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR)));
299 299
       TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe")));
300 300
       TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, PSTR("Stow Probe"), CONTINUE_STR));
301 301
       TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());

Loading…
İptal
Kaydet