🎨 Apply F() to kill / sendinfoscreen

This commit is contained in:
Scott Lahteine 2021-09-28 20:15:52 -05:00
parent 492d70424d
commit 3d102a77ca
52 changed files with 149 additions and 123 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -38,6 +38,12 @@ public:
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
// The bools specifying whether the strings are in RAM or FLASH. // The bools specifying whether the strings are in RAM or FLASH.
static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
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) {
sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
}
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) {
sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
}
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); 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);

View file

@ -38,6 +38,12 @@ public:
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
// The bools specifying whether the strings are in RAM or FLASH. // The bools specifying whether the strings are in RAM or FLASH.
static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
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) {
sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
}
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) {
sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
}
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); 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);

View file

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

View file

@ -38,6 +38,12 @@ public:
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
// The bools specifying whether the strings are in RAM or FLASH. // The bools specifying whether the strings are in RAM or FLASH.
static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
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) {
sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
}
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) {
sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
}
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); 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);

View file

@ -38,6 +38,12 @@ public:
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
// The bools specifying whether the strings are in RAM or FLASH. // The bools specifying whether the strings are in RAM or FLASH.
static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
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) {
sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
}
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) {
sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
}
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); 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);

View file

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

View file

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

View file

@ -46,7 +46,7 @@ namespace ExtUI {
} }
} }
void onPrinterKilled(PGM_P error, PGM_P component) { void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
dgus_screen_handler.PrinterKilled(error, component); dgus_screen_handler.PrinterKilled(error, component);
} }

View file

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

View file

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

View file

@ -74,35 +74,36 @@ uint16_t inbound_count;
bool last_printing_status = false; bool last_printing_status = false;
// Everything written needs the high bit set. // Everything written needs the high bit set.
void write_to_lcd_P(PGM_P const message) { void write_to_lcd(FSTR_P const fmsg) {
PGM_P pmsg = FTOP(fmsg);
char encoded_message[MAX_CURLY_COMMAND]; char encoded_message[MAX_CURLY_COMMAND];
uint8_t message_length = _MIN(strlen_P(message), sizeof(encoded_message)); uint8_t message_length = _MIN(strlen_P(pmsg), sizeof(encoded_message));
LOOP_L_N(i, message_length) LOOP_L_N(i, message_length)
encoded_message[i] = pgm_read_byte(&message[i]) | 0x80; encoded_message[i] = pgm_read_byte(&pmsg[i]) | 0x80;
LCD_SERIAL.Print::write(encoded_message, message_length); LCD_SERIAL.Print::write(encoded_message, message_length);
} }
void write_to_lcd(const char * const message) { void write_to_lcd(const char * const cmsg) {
char encoded_message[MAX_CURLY_COMMAND]; char encoded_message[MAX_CURLY_COMMAND];
const uint8_t message_length = _MIN(strlen(message), sizeof(encoded_message)); const uint8_t message_length = _MIN(strlen(cmsg), sizeof(encoded_message));
LOOP_L_N(i, message_length) LOOP_L_N(i, message_length)
encoded_message[i] = message[i] | 0x80; encoded_message[i] = cmsg[i] | 0x80;
LCD_SERIAL.Print::write(encoded_message, message_length); LCD_SERIAL.Print::write(encoded_message, message_length);
} }
// {E:<msg>} is for error states. // {E:<msg>} is for error states.
void set_lcd_error_P(PGM_P const error, PGM_P const component/*=nullptr*/) { void set_lcd_error(FSTR_P const error, FSTR_P const component/*=nullptr*/) {
write_to_lcd_P(PSTR("{E:")); write_to_lcd(F("{E:"));
write_to_lcd_P(error); write_to_lcd(error);
if (component) { if (component) {
write_to_lcd_P(PSTR(" ")); write_to_lcd(F(" "));
write_to_lcd_P(component); write_to_lcd(component);
} }
write_to_lcd_P(PSTR("}")); write_to_lcd(F("}"));
} }
@ -243,16 +244,16 @@ void process_lcd_p_command(const char *command) {
switch (command[0]) { switch (command[0]) {
case 'P': case 'P':
ExtUI::pausePrint(); ExtUI::pausePrint();
write_to_lcd_P(PSTR("{SYS:PAUSED}")); write_to_lcd(F("{SYS:PAUSED}"));
break; break;
case 'R': case 'R':
ExtUI::resumePrint(); ExtUI::resumePrint();
write_to_lcd_P(PSTR("{SYS:RESUMED}")); write_to_lcd(F("{SYS:RESUMED}"));
break; break;
case 'X': case 'X':
write_to_lcd_P(PSTR("{SYS:CANCELING}")); write_to_lcd(F("{SYS:CANCELING}"));
ExtUI::stopPrint(); ExtUI::stopPrint();
write_to_lcd_P(PSTR("{SYS:STARTED}")); write_to_lcd(F("{SYS:STARTED}"));
break; break;
case 'H': queue.enqueue_now_P(G28_STR); break; // Home all axes case 'H': queue.enqueue_now_P(G28_STR); break; // Home all axes
default: { default: {
@ -271,13 +272,13 @@ void process_lcd_p_command(const char *command) {
// but the V2 LCD switches to "print" mode on {SYS:DIR} response. // but the V2 LCD switches to "print" mode on {SYS:DIR} response.
if (card.flag.filenameIsDir) { if (card.flag.filenameIsDir) {
card.cd(card.filename); card.cd(card.filename);
write_to_lcd_P(PSTR("{SYS:DIR}")); write_to_lcd(F("{SYS:DIR}"));
} }
else { else {
char message_buffer[MAX_CURLY_COMMAND]; char message_buffer[MAX_CURLY_COMMAND];
sprintf_P(message_buffer, PSTR("{PRINTFILE:%s}"), card.longest_filename()); sprintf_P(message_buffer, PSTR("{PRINTFILE:%s}"), card.longest_filename());
write_to_lcd(message_buffer); write_to_lcd(message_buffer);
write_to_lcd_P(PSTR("{SYS:BUILD}")); write_to_lcd(F("{SYS:BUILD}"));
card.openAndPrintFile(card.filename); card.openAndPrintFile(card.filename);
} }
#endif #endif
@ -332,7 +333,7 @@ void process_lcd_s_command(const char *command) {
write_to_lcd(message_buffer); write_to_lcd(message_buffer);
} }
write_to_lcd_P(PSTR("{SYS:OK}")); write_to_lcd(F("{SYS:OK}"));
#endif #endif
} break; } break;
@ -413,7 +414,7 @@ void update_usb_status(const bool forceUpdate) {
// This is more logical. // This is more logical.
if (last_usb_connected_status != MYSERIAL1.connected() || forceUpdate) { if (last_usb_connected_status != MYSERIAL1.connected() || forceUpdate) {
last_usb_connected_status = MYSERIAL1.connected(); last_usb_connected_status = MYSERIAL1.connected();
write_to_lcd_P(last_usb_connected_status ? PSTR("{R:UC}\r\n") : PSTR("{R:UD}\r\n")); write_to_lcd(last_usb_connected_status ? F("{R:UC}\r\n") : F("{R:UD}\r\n"));
} }
} }

View file

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

View file

@ -55,13 +55,13 @@ namespace ExtUI {
LCD_SERIAL.begin(LCD_BAUDRATE); LCD_SERIAL.begin(LCD_BAUDRATE);
// Signal init // Signal init
write_to_lcd_P(PSTR("{SYS:STARTED}\r\n")); write_to_lcd(F("{SYS:STARTED}\r\n"));
// send a version that says "unsupported" // send a version that says "unsupported"
write_to_lcd_P(PSTR("{VER:99}\r\n")); write_to_lcd(F("{VER:99}\r\n"));
// No idea why it does this twice. // No idea why it does this twice.
write_to_lcd_P(PSTR("{SYS:STARTED}\r\n")); write_to_lcd(F("{SYS:STARTED}\r\n"));
update_usb_status(true); update_usb_status(true);
} }
@ -98,8 +98,8 @@ namespace ExtUI {
#endif #endif
} }
void onPrinterKilled(PGM_P const error, PGM_P const component) { void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
set_lcd_error_P(error, component); set_lcd_error(error, component);
} }
#if HAS_PID_HEATING #if HAS_PID_HEATING
@ -109,28 +109,28 @@ namespace ExtUI {
//SERIAL_ECHOLNPGM("OnPidTuning:", rst); //SERIAL_ECHOLNPGM("OnPidTuning:", rst);
switch (rst) { switch (rst) {
case PID_STARTED: case PID_STARTED:
set_lcd_error_P(GET_TEXT(MSG_PID_AUTOTUNE)); set_lcd_error(GET_TEXT_F(MSG_PID_AUTOTUNE));
break; break;
case PID_BAD_EXTRUDER_NUM: case PID_BAD_EXTRUDER_NUM:
set_lcd_error_P(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM)); set_lcd_error(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM));
break; break;
case PID_TEMP_TOO_HIGH: case PID_TEMP_TOO_HIGH:
set_lcd_error_P(GET_TEXT(MSG_PID_TEMP_TOO_HIGH)); set_lcd_error(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH));
break; break;
case PID_TUNING_TIMEOUT: case PID_TUNING_TIMEOUT:
set_lcd_error_P(GET_TEXT(MSG_PID_TIMEOUT)); set_lcd_error(GET_TEXT_F(MSG_PID_TIMEOUT));
break; break;
case PID_DONE: case PID_DONE:
set_lcd_error_P(GET_TEXT(MSG_PID_AUTOTUNE_DONE)); set_lcd_error(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE));
break; break;
} }
} }
#endif #endif
void onPrintTimerStarted() { write_to_lcd_P(PSTR("{SYS:BUILD}")); } void onPrintTimerStarted() { write_to_lcd(F("{SYS:BUILD}")); }
void onPrintTimerPaused() {} void onPrintTimerPaused() {}
void onPrintTimerStopped() { write_to_lcd_P(PSTR("{TQ:100}")); } void onPrintTimerStopped() { write_to_lcd(F("{TQ:100}")); }
// Not needed for Malyan LCD // Not needed for Malyan LCD
void onStatusChanged(const char * const) {} void onStatusChanged(const char * const) {}

View file

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

View file

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

View file

@ -84,12 +84,12 @@ void NextionTFT::IdleLoop() {
UpdateOnChange(); UpdateOnChange();
} }
void NextionTFT::PrinterKilled(PGM_P error, PGM_P component) { void NextionTFT::PrinterKilled(FSTR_P const error, FSTR_P const component) {
SEND_TXT_END("page error"); SEND_TXT_END("page error");
SEND_TXT("t3", "Error"); SEND_TXT_F("t3", F("Error"));
SEND_TXT_P("t4", component); SEND_TXT_F("t4", component);
SEND_TXT_P("t5", error); SEND_TXT_F("t5", error);
SEND_TXT("t6", "Need reset"); SEND_TXT_F("t6", F("Need reset"));
} }
void NextionTFT::PrintFinished() { void NextionTFT::PrintFinished() {

View file

@ -56,8 +56,8 @@
#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"))) #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")))
#define SEND_VAL(x,y) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".val=")), LCD_SERIAL.print(y), nextion.SendtoTFT(F("\xFF\xFF\xFF"))) #define SEND_VAL(x,y) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".val=")), LCD_SERIAL.print(y), nextion.SendtoTFT(F("\xFF\xFF\xFF")))
#define SEND_TXT(x,y) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), nextion.SendtoTFT(F(y)), nextion.SendtoTFT(F("\"\xFF\xFF\xFF"))) #define SEND_TXT(x,y) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), nextion.SendtoTFT(F(y)), nextion.SendtoTFT(F("\"\xFF\xFF\xFF")))
#define SEND_TXT_P(x,y) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), nextion.SendtoTFT(y), nextion.SendtoTFT(F("\"\xFF\xFF\xFF"))) #define SEND_TXT_F(x,y) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), nextion.SendtoTFT(y), nextion.SendtoTFT(F("\"\xFF\xFF\xFF")))
#define SEND_VALasTXT(x,y) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), LCD_SERIAL.print(y), nextion.SendtoTFT(F("\"\xFF\xFF\xFF"))) #define SEND_VALasTXT(x,y) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F(".txt=\"")), LCD_SERIAL.print(y), nextion.SendtoTFT(F("\"\xFF\xFF\xFF")))
#define SEND_TXT_END(x) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F("\xFF\xFF\xFF"))) #define SEND_TXT_END(x) (nextion.SendtoTFT(F(x)), nextion.SendtoTFT(F("\xFF\xFF\xFF")))
#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"))) #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")))

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -187,8 +187,8 @@
Temperature thermalManager; Temperature thermalManager;
const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY, PGMSTR(str_t_thermal_runaway, STR_T_THERMAL_RUNAWAY);
str_t_heating_failed[] PROGMEM = STR_T_HEATING_FAILED; PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
/** /**
* Macros to include the heater id in temp errors. The compiler's dead-code * 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,
*/ */
#if HAS_HEATED_BED #if HAS_HEATED_BED
#define _BED_PSTR(h) (h) == H_BED ? GET_TEXT(MSG_BED) : #define _BED_FSTR(h) (h) == H_BED ? GET_TEXT_F(MSG_BED) :
#else #else
#define _BED_PSTR(h) #define _BED_FSTR(h)
#endif #endif
#if HAS_HEATED_CHAMBER #if HAS_HEATED_CHAMBER
#define _CHAMBER_PSTR(h) (h) == H_CHAMBER ? GET_TEXT(MSG_CHAMBER) : #define _CHAMBER_FSTR(h) (h) == H_CHAMBER ? GET_TEXT_F(MSG_CHAMBER) :
#else #else
#define _CHAMBER_PSTR(h) #define _CHAMBER_FSTR(h)
#endif #endif
#if HAS_COOLER #if HAS_COOLER
#define _COOLER_PSTR(h) (h) == H_COOLER ? GET_TEXT(MSG_COOLER) : #define _COOLER_FSTR(h) (h) == H_COOLER ? GET_TEXT_F(MSG_COOLER) :
#else #else
#define _COOLER_PSTR(h) #define _COOLER_FSTR(h)
#endif #endif
#define _E_PSTR(h,N) ((HOTENDS) > N && (h) == N) ? PSTR(LCD_STR_E##N) : #define _E_FSTR(h,N) ((HOTENDS) > N && (h) == N) ? F(LCD_STR_E##N) :
#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) #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)
// //
// Initialize MAX TC objects/SPI // Initialize MAX TC objects/SPI
@ -731,10 +731,10 @@ volatile bool Temperature::raw_temps_ready = false;
if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached
} }
else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired
_temp_error(heater_id, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); _temp_error(heater_id, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
} }
else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far?
_temp_error(heater_id, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY)); _temp_error(heater_id, FPSTR(str_t_thermal_runaway), GET_TEXT_F(MSG_THERMAL_RUNAWAY));
} }
#endif #endif
} // every 2 seconds } // every 2 seconds
@ -951,7 +951,7 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
// Temperature Error Handlers // Temperature Error Handlers
// //
inline void loud_kill(PGM_P const lcd_msg, const heater_id_t heater_id) { inline void loud_kill(FSTR_P const lcd_msg, const heater_id_t heater_id) {
marlin_state = MF_KILLED; marlin_state = MF_KILLED;
thermalManager.disable_all_heaters(); thermalManager.disable_all_heaters();
#if USE_BEEPER #if USE_BEEPER
@ -967,16 +967,16 @@ inline void loud_kill(PGM_P const lcd_msg, const heater_id_t heater_id) {
} }
WRITE(BEEPER_PIN, HIGH); WRITE(BEEPER_PIN, HIGH);
#endif #endif
kill(lcd_msg, HEATER_PSTR(heater_id)); kill(lcd_msg, HEATER_FSTR(heater_id));
} }
void Temperature::_temp_error(const heater_id_t heater_id, PGM_P const serial_msg, PGM_P const lcd_msg) { void Temperature::_temp_error(const heater_id_t heater_id, FSTR_P const serial_msg, FSTR_P const lcd_msg) {
static uint8_t killed = 0; static uint8_t killed = 0;
if (IsRunning() && TERN1(BOGUS_TEMPERATURE_GRACE_PERIOD, killed == 2)) { if (IsRunning() && TERN1(BOGUS_TEMPERATURE_GRACE_PERIOD, killed == 2)) {
SERIAL_ERROR_START(); SERIAL_ERROR_START();
SERIAL_ECHOPGM_P(serial_msg); SERIAL_ECHOF(serial_msg);
SERIAL_ECHOPGM(STR_STOPPED_HEATER); SERIAL_ECHOPGM(STR_STOPPED_HEATER);
heater_id_t real_heater_id = heater_id; heater_id_t real_heater_id = heater_id;
@ -1031,14 +1031,14 @@ void Temperature::max_temp_error(const heater_id_t heater_id) {
#if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED) #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED)
DWIN_Popup_Temperature(1); DWIN_Popup_Temperature(1);
#endif #endif
_temp_error(heater_id, PSTR(STR_T_MAXTEMP), GET_TEXT(MSG_ERR_MAXTEMP)); _temp_error(heater_id, F(STR_T_MAXTEMP), GET_TEXT_F(MSG_ERR_MAXTEMP));
} }
void Temperature::min_temp_error(const heater_id_t heater_id) { void Temperature::min_temp_error(const heater_id_t heater_id) {
#if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED) #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED)
DWIN_Popup_Temperature(0); DWIN_Popup_Temperature(0);
#endif #endif
_temp_error(heater_id, PSTR(STR_T_MINTEMP), GET_TEXT(MSG_ERR_MINTEMP)); _temp_error(heater_id, F(STR_T_MINTEMP), GET_TEXT_F(MSG_ERR_MINTEMP));
} }
#if ANY(PID_DEBUG, PID_BED_DEBUG, PID_CHAMBER_DEBUG) #if ANY(PID_DEBUG, PID_BED_DEBUG, PID_CHAMBER_DEBUG)
@ -1294,7 +1294,7 @@ void Temperature::manage_heater() {
REMEMBER(mh, no_reentry, true); REMEMBER(mh, no_reentry, true);
#if ENABLED(EMERGENCY_PARSER) #if ENABLED(EMERGENCY_PARSER)
if (emergency_parser.killed_by_M112) kill(M112_KILL_STR, nullptr, true); if (emergency_parser.killed_by_M112) kill(FPSTR(M112_KILL_STR), nullptr, true);
if (emergency_parser.quickstop_by_M410) { if (emergency_parser.quickstop_by_M410) {
emergency_parser.quickstop_by_M410 = false; // quickstop_stepper may call idle so clear this now! emergency_parser.quickstop_by_M410 = false; // quickstop_stepper may call idle so clear this now!
@ -1344,7 +1344,7 @@ void Temperature::manage_heater() {
start_watching_hotend(e); // If temp reached, turn off elapsed check start_watching_hotend(e); // If temp reached, turn off elapsed check
else { else {
TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0)); TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0));
_temp_error((heater_id_t)e, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); _temp_error((heater_id_t)e, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
} }
} }
#endif #endif
@ -1356,7 +1356,7 @@ void Temperature::manage_heater() {
#if HAS_TEMP_REDUNDANT #if HAS_TEMP_REDUNDANT
// Make sure measured temperatures are close together // Make sure measured temperatures are close together
if (ABS(degRedundantTarget() - degRedundant()) > TEMP_SENSOR_REDUNDANT_MAX_DIFF) if (ABS(degRedundantTarget() - degRedundant()) > TEMP_SENSOR_REDUNDANT_MAX_DIFF)
_temp_error((heater_id_t)HEATER_ID(TEMP_SENSOR_REDUNDANT_TARGET), PSTR(STR_REDUNDANCY), GET_TEXT(MSG_ERR_REDUNDANT_TEMP)); _temp_error((heater_id_t)HEATER_ID(TEMP_SENSOR_REDUNDANT_TARGET), F(STR_REDUNDANCY), GET_TEXT_F(MSG_ERR_REDUNDANT_TEMP));
#endif #endif
#if HAS_AUTO_FAN #if HAS_AUTO_FAN
@ -1387,7 +1387,7 @@ void Temperature::manage_heater() {
start_watching_bed(); // If temp reached, turn off elapsed check start_watching_bed(); // If temp reached, turn off elapsed check
else { else {
TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0)); TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0));
_temp_error(H_BED, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); _temp_error(H_BED, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
} }
} }
#endif // WATCH_BED #endif // WATCH_BED
@ -1467,7 +1467,7 @@ void Temperature::manage_heater() {
if (watch_chamber.check(degChamber())) // Increased enough? Error below. if (watch_chamber.check(degChamber())) // Increased enough? Error below.
start_watching_chamber(); // If temp reached, turn off elapsed check. start_watching_chamber(); // If temp reached, turn off elapsed check.
else else
_temp_error(H_CHAMBER, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); _temp_error(H_CHAMBER, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
} }
#endif #endif
@ -1589,7 +1589,7 @@ void Temperature::manage_heater() {
// Make sure temperature is decreasing // Make sure temperature is decreasing
if (watch_cooler.elapsed(ms)) { // Time to check the cooler? if (watch_cooler.elapsed(ms)) { // Time to check the cooler?
if (degCooler() > watch_cooler.target) // Failed to decrease enough? if (degCooler() > watch_cooler.target) // Failed to decrease enough?
_temp_error(H_COOLER, GET_TEXT(MSG_COOLING_FAILED), GET_TEXT(MSG_COOLING_FAILED)); _temp_error(H_COOLER, GET_TEXT_F(MSG_COOLING_FAILED), GET_TEXT_F(MSG_COOLING_FAILED));
else else
start_watching_cooler(); // Start again if the target is still far off start_watching_cooler(); // Start again if the target is still far off
} }
@ -2597,7 +2597,7 @@ void Temperature::init() {
case TRRunaway: case TRRunaway:
TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0)); TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0));
_temp_error(heater_id, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY)); _temp_error(heater_id, FPSTR(str_t_thermal_runaway), GET_TEXT_F(MSG_THERMAL_RUNAWAY));
} }
} }
@ -3896,7 +3896,7 @@ void Temperature::isr() {
const bool wants_to_cool = isProbeAboveTemp(target_temp), const bool wants_to_cool = isProbeAboveTemp(target_temp),
will_wait = !(wants_to_cool && no_wait_for_cooling); will_wait = !(wants_to_cool && no_wait_for_cooling);
if (will_wait) if (will_wait)
SERIAL_ECHOLNPGM("Waiting for probe to ", (wants_to_cool ? PSTR("cool down") : PSTR("heat up")), " to ", target_temp, " degrees."); SERIAL_ECHOLNPGM("Waiting for probe to ", wants_to_cool ? F("cool down") : F("heat up"), " to ", target_temp, " degrees.");
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
KEEPALIVE_STATE(NOT_BUSY); KEEPALIVE_STATE(NOT_BUSY);

View file

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

View file

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

View file

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