🎨 Apply F() to Host Actions strings
This commit is contained in:
parent
7f1286a11f
commit
008bf1bcae
|
@ -37,33 +37,33 @@
|
|||
#include "runout.h"
|
||||
#endif
|
||||
|
||||
void host_action(PGM_P const pstr, const bool eol) {
|
||||
void host_action(FSTR_P const fstr, const bool eol) {
|
||||
PORT_REDIRECT(SerialMask::All);
|
||||
SERIAL_ECHOPGM("//action:");
|
||||
SERIAL_ECHOPGM_P(pstr);
|
||||
SERIAL_ECHOF(fstr);
|
||||
if (eol) SERIAL_EOL();
|
||||
}
|
||||
|
||||
#ifdef ACTION_ON_KILL
|
||||
void host_action_kill() { host_action(PSTR(ACTION_ON_KILL)); }
|
||||
void host_action_kill() { host_action(F(ACTION_ON_KILL)); }
|
||||
#endif
|
||||
#ifdef ACTION_ON_PAUSE
|
||||
void host_action_pause(const bool eol/*=true*/) { host_action(PSTR(ACTION_ON_PAUSE), eol); }
|
||||
void host_action_pause(const bool eol/*=true*/) { host_action(F(ACTION_ON_PAUSE), eol); }
|
||||
#endif
|
||||
#ifdef ACTION_ON_PAUSED
|
||||
void host_action_paused(const bool eol/*=true*/) { host_action(PSTR(ACTION_ON_PAUSED), eol); }
|
||||
void host_action_paused(const bool eol/*=true*/) { host_action(F(ACTION_ON_PAUSED), eol); }
|
||||
#endif
|
||||
#ifdef ACTION_ON_RESUME
|
||||
void host_action_resume() { host_action(PSTR(ACTION_ON_RESUME)); }
|
||||
void host_action_resume() { host_action(F(ACTION_ON_RESUME)); }
|
||||
#endif
|
||||
#ifdef ACTION_ON_RESUMED
|
||||
void host_action_resumed() { host_action(PSTR(ACTION_ON_RESUMED)); }
|
||||
void host_action_resumed() { host_action(F(ACTION_ON_RESUMED)); }
|
||||
#endif
|
||||
#ifdef ACTION_ON_CANCEL
|
||||
void host_action_cancel() { host_action(PSTR(ACTION_ON_CANCEL)); }
|
||||
void host_action_cancel() { host_action(F(ACTION_ON_CANCEL)); }
|
||||
#endif
|
||||
#ifdef ACTION_ON_START
|
||||
void host_action_start() { host_action(PSTR(ACTION_ON_START)); }
|
||||
void host_action_start() { host_action(F(ACTION_ON_START)); }
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
|
@ -77,60 +77,60 @@ void host_action(PGM_P const pstr, const bool eol) {
|
|||
|
||||
PromptReason host_prompt_reason = PROMPT_NOT_DEFINED;
|
||||
|
||||
void host_action_notify(const char * const message) {
|
||||
void host_action_notify(const char * const cstr) {
|
||||
PORT_REDIRECT(SerialMask::All);
|
||||
host_action(PSTR("notification "), false);
|
||||
SERIAL_ECHOLN(message);
|
||||
host_action(F("notification "), false);
|
||||
SERIAL_ECHOLN(cstr);
|
||||
}
|
||||
|
||||
void host_action_notify_P(PGM_P const message) {
|
||||
void host_action_notify(FSTR_P const fstr) {
|
||||
PORT_REDIRECT(SerialMask::All);
|
||||
host_action(PSTR("notification "), false);
|
||||
SERIAL_ECHOLNPGM_P(message);
|
||||
host_action(F("notification "), false);
|
||||
SERIAL_ECHOLNF(fstr);
|
||||
}
|
||||
|
||||
void host_action_prompt(PGM_P const ptype, const bool eol=true) {
|
||||
void host_action_prompt(FSTR_P const ptype, const bool eol=true) {
|
||||
PORT_REDIRECT(SerialMask::All);
|
||||
host_action(PSTR("prompt_"), false);
|
||||
SERIAL_ECHOPGM_P(ptype);
|
||||
host_action(F("prompt_"), false);
|
||||
SERIAL_ECHOF(ptype);
|
||||
if (eol) SERIAL_EOL();
|
||||
}
|
||||
|
||||
void host_action_prompt_plus(PGM_P const ptype, PGM_P const pstr, const char extra_char='\0') {
|
||||
void host_action_prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0') {
|
||||
host_action_prompt(ptype, false);
|
||||
PORT_REDIRECT(SerialMask::All);
|
||||
SERIAL_CHAR(' ');
|
||||
SERIAL_ECHOPGM_P(pstr);
|
||||
SERIAL_ECHOF(fstr);
|
||||
if (extra_char != '\0') SERIAL_CHAR(extra_char);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
void host_action_prompt_begin(const PromptReason reason, PGM_P const pstr, const char extra_char/*='\0'*/) {
|
||||
void host_action_prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
|
||||
host_action_prompt_end();
|
||||
host_prompt_reason = reason;
|
||||
host_action_prompt_plus(PSTR("begin"), pstr, extra_char);
|
||||
host_action_prompt_plus(F("begin"), fstr, extra_char);
|
||||
}
|
||||
void host_action_prompt_button(PGM_P const pstr) { host_action_prompt_plus(PSTR("button"), pstr); }
|
||||
void host_action_prompt_end() { host_action_prompt(PSTR("end")); }
|
||||
void host_action_prompt_show() { host_action_prompt(PSTR("show")); }
|
||||
void host_action_prompt_button(FSTR_P const fstr) { host_action_prompt_plus(F("button"), fstr); }
|
||||
void host_action_prompt_end() { host_action_prompt(F("end")); }
|
||||
void host_action_prompt_show() { host_action_prompt(F("show")); }
|
||||
|
||||
void _host_prompt_show(PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) {
|
||||
void _host_prompt_show(FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
|
||||
if (btn1) host_action_prompt_button(btn1);
|
||||
if (btn2) host_action_prompt_button(btn2);
|
||||
host_action_prompt_show();
|
||||
}
|
||||
void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) {
|
||||
host_action_prompt_begin(reason, pstr);
|
||||
void host_prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
|
||||
host_action_prompt_begin(reason, fstr);
|
||||
_host_prompt_show(btn1, btn2);
|
||||
}
|
||||
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*/) {
|
||||
host_action_prompt_begin(reason, pstr, extra_char);
|
||||
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*/) {
|
||||
host_action_prompt_begin(reason, fstr, extra_char);
|
||||
_host_prompt_show(btn1, btn2);
|
||||
}
|
||||
|
||||
void filament_load_host_prompt() {
|
||||
const bool disable_to_continue = TERN0(HAS_FILAMENT_SENSOR, runout.filament_ran_out);
|
||||
host_prompt_do(PROMPT_FILAMENT_RUNOUT, PSTR("Paused"), PSTR("PurgeMore"),
|
||||
disable_to_continue ? PSTR("DisableRunout") : CONTINUE_STR
|
||||
host_prompt_do(PROMPT_FILAMENT_RUNOUT, F("Paused"), F("PurgeMore"),
|
||||
disable_to_continue ? F("DisableRunout") : FPSTR(CONTINUE_STR)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "../inc/MarlinConfigPre.h"
|
||||
#include "../HAL/shared/Marduino.h"
|
||||
|
||||
void host_action(PGM_P const pstr, const bool eol=true);
|
||||
void host_action(FSTR_P const fstr, const bool eol=true);
|
||||
|
||||
#ifdef ACTION_ON_KILL
|
||||
void host_action_kill();
|
||||
|
@ -64,16 +64,16 @@ void host_action(PGM_P const pstr, const bool eol=true);
|
|||
extern PromptReason host_prompt_reason;
|
||||
|
||||
void host_response_handler(const uint8_t response);
|
||||
void host_action_notify(const char * const message);
|
||||
void host_action_notify_P(PGM_P const message);
|
||||
void host_action_prompt_begin(const PromptReason reason, PGM_P const pstr, const char extra_char='\0');
|
||||
void host_action_prompt_button(PGM_P const pstr);
|
||||
void host_action_notify(const char * const cstr);
|
||||
void host_action_notify(FSTR_P const fstr);
|
||||
void host_action_prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
|
||||
void host_action_prompt_button(FSTR_P const fstr);
|
||||
void host_action_prompt_end();
|
||||
void host_action_prompt_show();
|
||||
void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr);
|
||||
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);
|
||||
inline void host_prompt_open(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr) {
|
||||
if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, btn1, btn2);
|
||||
void host_prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
|
||||
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);
|
||||
inline void host_prompt_open(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
|
||||
if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, fstr, btn1, btn2);
|
||||
}
|
||||
|
||||
void filament_load_host_prompt();
|
||||
|
|
|
@ -960,7 +960,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
|
|||
if (recover) {
|
||||
LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
|
||||
BUZZ(200, 404);
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover")));
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
|
||||
BUZZ(200, 404);
|
||||
|
|
|
@ -198,7 +198,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
|
|||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder);
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Load Filament T"), tool, CONTINUE_STR);
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, F("Load Filament T"), tool, FPSTR(CONTINUE_STR));
|
||||
#endif
|
||||
|
||||
while (wait_for_user) {
|
||||
|
@ -253,7 +253,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
|
|||
if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE)));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_FILAMENT_CHANGE_PURGE), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
|
||||
TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT(MSG_FILAMENT_CHANGE_PURGE), CONTINUE_STR));
|
||||
wait_for_user = true; // A click or M108 breaks the purge_length loop
|
||||
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
|
|||
#endif
|
||||
#endif
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("Pause"), DISMISS_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR)));
|
||||
|
||||
// Indicate that the printer is paused
|
||||
++did_pause_print;
|
||||
|
@ -512,7 +512,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
|||
|
||||
// Wait for filament insert by user and press button
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_NOZZLE_PARKED), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_NOZZLE_PARKED), FPSTR(CONTINUE_STR)));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_NOZZLE_PARKED)));
|
||||
wait_for_user = true; // LCD click or M108 will clear this
|
||||
while (wait_for_user) {
|
||||
|
@ -528,13 +528,13 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
|||
ui.pause_show_message(PAUSE_MESSAGE_HEAT);
|
||||
SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT));
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_HEATER_TIMEOUT), GET_TEXT(MSG_REHEAT)));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_HEATER_TIMEOUT)));
|
||||
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(0, true)); // Wait for LCD click or M108
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, GET_TEXT(MSG_REHEATING)));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING)));
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged_P(GET_TEXT(MSG_REHEATING)));
|
||||
|
||||
|
@ -554,7 +554,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
|||
|
||||
HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout);
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_REHEATDONE), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR)));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_REHEATDONE)));
|
||||
TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATDONE));
|
||||
|
||||
|
@ -671,7 +671,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
|
|||
|
||||
--did_pause_print;
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("Resuming"), DISMISS_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Resuming"), FPSTR(DISMISS_STR)));
|
||||
|
||||
// Resume the print job timer if it was running
|
||||
if (print_job_timer.isPaused()) print_job_timer.start();
|
||||
|
|
|
@ -96,7 +96,7 @@ void event_filament_runout(const uint8_t extruder) {
|
|||
|
||||
//action:out_of_filament
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_action_prompt_begin(PROMPT_FILAMENT_RUNOUT, PSTR("FilamentRunout T"), tool);
|
||||
host_action_prompt_begin(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool);
|
||||
host_action_prompt_show();
|
||||
#endif
|
||||
|
||||
|
@ -115,7 +115,7 @@ void event_filament_runout(const uint8_t extruder) {
|
|||
// Legacy Repetier command for use until newer version supports standard dialog
|
||||
// To be removed later when pause command also triggers dialog
|
||||
#ifdef ACTION_ON_FILAMENT_RUNOUT
|
||||
host_action(PSTR(ACTION_ON_FILAMENT_RUNOUT " T"), false);
|
||||
host_action(F(ACTION_ON_FILAMENT_RUNOUT " T"), false);
|
||||
SERIAL_CHAR(tool);
|
||||
SERIAL_EOL();
|
||||
#endif
|
||||
|
|
|
@ -344,7 +344,7 @@ void GcodeSuite::M43() {
|
|||
#if HAS_RESUME_CONTINUE
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = true;
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("M43 Wait Called"), FPSTR(CONTINUE_STR)));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("M43 Wait Called")));
|
||||
#endif
|
||||
|
||||
|
|
|
@ -237,9 +237,9 @@ void GcodeSuite::dwell(millis_t time) {
|
|||
#if ENABLED(G29_RETRY_AND_RECOVER)
|
||||
|
||||
void GcodeSuite::event_probe_recover() {
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), DISMISS_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, F("G29 Retrying"), FPSTR(DISMISS_STR)));
|
||||
#ifdef ACTION_ON_G29_RECOVER
|
||||
host_action(PSTR(ACTION_ON_G29_RECOVER));
|
||||
host_action(F(ACTION_ON_G29_RECOVER));
|
||||
#endif
|
||||
#ifdef G29_RECOVER_COMMANDS
|
||||
process_subcommands_now(F(G29_RECOVER_COMMANDS));
|
||||
|
@ -252,7 +252,7 @@ void GcodeSuite::dwell(millis_t time) {
|
|||
|
||||
void GcodeSuite::event_probe_failure() {
|
||||
#ifdef ACTION_ON_G29_FAILURE
|
||||
host_action(PSTR(ACTION_ON_G29_FAILURE));
|
||||
host_action(F(ACTION_ON_G29_FAILURE));
|
||||
#endif
|
||||
#ifdef G29_FAILURE_COMMANDS
|
||||
process_subcommands_now(F(G29_FAILURE_COMMANDS));
|
||||
|
|
|
@ -84,7 +84,7 @@ void GcodeSuite::M0_M1() {
|
|||
|
||||
#endif
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR)));
|
||||
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ void GcodeSuite::M1001() {
|
|||
if (long_print) {
|
||||
printerEventLEDs.onPrintCompleted();
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_PRINT_DONE)));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_PRINT_DONE), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR)));
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30))));
|
||||
printerEventLEDs.onResumeAfterWait();
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ void GcodeSuite::M24() {
|
|||
#ifdef ACTION_ON_RESUME
|
||||
host_action_resume();
|
||||
#endif
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("Resuming SD"), DISMISS_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("Resuming SD"), FPSTR(DISMISS_STR)));
|
||||
#endif
|
||||
|
||||
ui.reset_status();
|
||||
|
@ -116,7 +116,7 @@ void GcodeSuite::M25() {
|
|||
IF_DISABLED(DWIN_CREALITY_LCD, ui.reset_status());
|
||||
|
||||
#if ENABLED(HOST_ACTION_COMMANDS)
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("Pause SD"), PSTR("Resume")));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, F("Pause SD"), F("Resume")));
|
||||
#ifdef ACTION_ON_PAUSE
|
||||
host_action_pause();
|
||||
#endif
|
||||
|
|
|
@ -1352,28 +1352,28 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||
|
||||
bool MarlinUI::has_status() { return (status_message[0] != '\0'); }
|
||||
|
||||
void MarlinUI::set_status(const char * const message, const bool persist) {
|
||||
void MarlinUI::set_status(const char * const cstr, const bool persist) {
|
||||
if (alert_level) return;
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_action_notify(message));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_action_notify(cstr));
|
||||
|
||||
// Here we have a problem. The message is encoded in UTF8, so
|
||||
// arbitrarily cutting it will be a problem. We MUST be sure
|
||||
// that there is no cutting in the middle of a multibyte character!
|
||||
|
||||
// Get a pointer to the null terminator
|
||||
const char* pend = message + strlen(message);
|
||||
const char* pend = cstr + strlen(cstr);
|
||||
|
||||
// If length of supplied UTF8 string is greater than
|
||||
// our buffer size, start cutting whole UTF8 chars
|
||||
while ((pend - message) > MAX_MESSAGE_LENGTH) {
|
||||
while ((pend - cstr) > MAX_MESSAGE_LENGTH) {
|
||||
--pend;
|
||||
while (!START_OF_UTF8_CHAR(*pend)) --pend;
|
||||
};
|
||||
|
||||
// At this point, we have the proper cut point. Use it
|
||||
uint8_t maxLen = pend - message;
|
||||
strncpy(status_message, message, maxLen);
|
||||
uint8_t maxLen = pend - cstr;
|
||||
strncpy(status_message, cstr, maxLen);
|
||||
status_message[maxLen] = '\0';
|
||||
|
||||
finish_status(persist);
|
||||
|
@ -1427,7 +1427,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||
if (level < alert_level) return;
|
||||
alert_level = level;
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_action_notify_P(pstr));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_action_notify(fstr));
|
||||
|
||||
// Since the message is encoded in UTF8 it must
|
||||
// only be cut on a character boundary.
|
||||
|
@ -1536,7 +1536,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||
host_action_cancel();
|
||||
#endif
|
||||
IF_DISABLED(SDSUPPORT, print_job_timer.stop());
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), DISMISS_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, F("UI Aborted"), FPSTR(DISMISS_STR)));
|
||||
LCD_MESSAGE(MSG_PRINT_ABORTED);
|
||||
TERN_(HAS_LCD_MENU, return_to_status());
|
||||
}
|
||||
|
@ -1565,7 +1565,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||
#endif
|
||||
|
||||
TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume")));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, F("UI Pause"), F("Resume")));
|
||||
|
||||
LCD_MESSAGE(MSG_PRINT_PAUSED);
|
||||
|
||||
|
@ -1642,10 +1642,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||
TERN(HOST_PROMPT_SUPPORT, host_action_notify(cstr), UNUSED(cstr));
|
||||
}
|
||||
void MarlinUI::set_status(FSTR_P const fstr, const int8_t) {
|
||||
TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(FTOP(fstr)), UNUSED(fstr));
|
||||
TERN(HOST_PROMPT_SUPPORT, host_action_notify(fstr), UNUSED(fstr));
|
||||
}
|
||||
void MarlinUI::status_printf(const uint8_t, FSTR_P const fstr, ...) {
|
||||
TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(FPSTR(fstr)), UNUSED(fstr));
|
||||
TERN(HOST_PROMPT_SUPPORT, host_action_notify(fstr), UNUSED(fstr));
|
||||
}
|
||||
|
||||
#endif // !HAS_DISPLAY && !HAS_STATUS_MESSAGE
|
||||
|
|
|
@ -64,7 +64,7 @@ void _man_probe_pt(const xy_pos_t &xy) {
|
|||
float lcd_probe_pt(const xy_pos_t &xy) {
|
||||
_man_probe_pt(xy);
|
||||
ui.defer_status_screen();
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Delta Calibration in progress"), FPSTR(CONTINUE_STR)));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress")));
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
|
||||
ui.goto_previous_screen_no_defer();
|
||||
|
|
|
@ -140,7 +140,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
|
|||
LCD_MESSAGE(MSG_MANUAL_DEPLOY_TOUCHMI);
|
||||
ui.return_to_status();
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI"), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Deploy TouchMI"), FPSTR(CONTINUE_STR)));
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
|
||||
ui.reset_status();
|
||||
ui.goto_screen(prev_screen);
|
||||
|
@ -295,7 +295,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
|
|||
ui.set_status(ds_str, 99);
|
||||
SERIAL_ECHOLNF(ds_str);
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR));
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR)));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe")));
|
||||
TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, PSTR("Stow Probe"), CONTINUE_STR));
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
|
||||
|
|
Loading…
Reference in a new issue