Skip to content

Commit

Permalink
馃帹 Apply F() to kill / sendinfoscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 25, 2021
1 parent 492d704 commit 3d102a7
Show file tree
Hide file tree
Showing 52 changed files with 149 additions and 123 deletions.
6 changes: 3 additions & 3 deletions Marlin/src/MarlinCore.cpp
Expand Up @@ -852,16 +852,16 @@ void idle(bool no_stepper_sleep/*=false*/) {
* Kill all activity and lock the machine.
* 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();

TERN_(HAS_CUTTER, cutter.kill()); // Full cutter shutdown including ISR control

// 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)
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
UNUSED(lcd_error); UNUSED(lcd_component);
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.h
Expand Up @@ -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
#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);

// Global State of the firmware
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/direct_stepping.cpp
Expand Up @@ -174,7 +174,7 @@ namespace DirectStepping {
template <typename Cfg>
void SerialPageManager<Cfg>::write_responses() {
if (fatal_error) {
kill(GET_TEXT(MSG_BAD_PAGE));
kill(GET_TEXT_F(MSG_BAD_PAGE));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/encoder_i2c.cpp
Expand Up @@ -153,7 +153,7 @@ void I2CPositionEncoder::update() {

#ifdef I2CPE_ERR_THRESH_ABORT
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);
safe_delay(5000);
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/mmu/mmu2.cpp
Expand Up @@ -448,7 +448,7 @@ bool MMU2::rx_ok() {
void MMU2::check_version() {
if (buildnr < MMU_REQUIRED_FW_BUILDNR) {
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));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/pause.cpp
Expand Up @@ -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_(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
for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/powerloss.cpp
Expand Up @@ -301,7 +301,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW
retract_and_lift(zraise);
#endif

kill(GET_TEXT(MSG_OUTAGE_RECOVERY));
kill(GET_TEXT_F(MSG_OUTAGE_RECOVERY));
}

#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/tmc_util.cpp
Expand Up @@ -212,7 +212,7 @@
if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature");
if (data.is_s2g) SERIAL_ECHOLNPGM("coil short circuit");
TERN_(TMC_DEBUG, tmc_report_all());
kill(PSTR("Driver error"));
kill(F("Driver error"));
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/control/M108_M112_M410.cpp
Expand Up @@ -40,7 +40,7 @@ void GcodeSuite::M108() {
* M112: Full Shutdown
*/
void GcodeSuite::M112() {
kill(M112_KILL_STR, nullptr, true);
kill(FPSTR(M112_KILL_STR), nullptr, true);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.cpp
Expand Up @@ -262,7 +262,7 @@ void GcodeSuite::dwell(millis_t time) {
#ifdef ACTION_ON_CANCEL
host_action_cancel();
#endif
kill(GET_TEXT(MSG_LCD_PROBING_FAILED));
kill(GET_TEXT_F(MSG_LCD_PROBING_FAILED));
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode_d.cpp
Expand Up @@ -58,7 +58,7 @@ void GcodeSuite::D(const int16_t dcode) {
break;

case 10:
kill(PSTR("D10"), PSTR("KILL TEST"), parser.seen_test('P'));
kill(F("D10"), F("KILL TEST"), parser.seen_test('P'));
break;

case 1: {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/host/M16.cpp
Expand Up @@ -33,7 +33,7 @@
void GcodeSuite::M16() {

if (strcmp_P(parser.string_arg, PSTR(MACHINE_NAME)))
kill(GET_TEXT(MSG_KILL_EXPECTED_PRINTER));
kill(GET_TEXT_F(MSG_KILL_EXPECTED_PRINTER));

}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/lcd/M0_M1.cpp
Expand Up @@ -67,7 +67,7 @@ void GcodeSuite::M0_M1() {

#elif ENABLED(EXTENSIBLE_UI)
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
ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_USERWAIT));
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/queue.cpp
Expand Up @@ -523,7 +523,7 @@ void GCodeQueue::get_serial_commands() {
// Process critical commands early
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 '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;
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/enhanced/dwin.cpp
Expand Up @@ -1852,7 +1852,7 @@ void DWIN_LoadSettings(const char *buff) {
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_UpdateLCD();
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/jyersui/dwin.cpp
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp
Expand Up @@ -41,8 +41,8 @@ namespace ExtUI {

void onIdle() { Chiron.IdleLoop(); }

void onPrinterKilled(PGM_P const error, PGM_P const component) {
Chiron.PrinterKilled(error,component);
void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
Chiron.PrinterKilled(error, component);
}

void onMediaInserted() { Chiron.MediaEvent(AC_media_inserted); }
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp
Expand Up @@ -126,7 +126,7 @@ void ChironTFT::IdleLoop() {
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);
#if ACDEBUG(AC_MARLIN)
SERIAL_ECHOLNPGM("PrinterKilled()\nerror: ", error , "\ncomponent: ", component);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.h
Expand Up @@ -59,7 +59,7 @@ class ChironTFT {
public:
static void Startup();
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 TimerEvent(timer_event_t);
static void FilamentRunout();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp
Expand Up @@ -37,7 +37,7 @@ namespace ExtUI {

void onStartup() { AnycubicTFT.OnSetup(); }
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 onMediaError() { AnycubicTFT.OnSDCardError(); }
void onMediaRemoved() { AnycubicTFT.OnSDCardStateChange(false); }
Expand Down
Expand Up @@ -654,7 +654,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
break;

case 12: // A12 kill
kill(PSTR(STR_ERR_KILLED));
kill(F(STR_ERR_KILLED));
break;

case 13: // A13 SELECTION FILE
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp
Expand Up @@ -340,7 +340,7 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)

void DGUSScreenHandler::SDCardError() {
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);
GotoScreen(DGUSLCD_SCREEN_POPUP);
}
Expand Down Expand Up @@ -567,7 +567,7 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
if (buf[0]) queue.enqueue_one_now(buf);

#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);
#endif
}
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/dgus/dgus_extui.cpp
Expand Up @@ -42,8 +42,8 @@ namespace ExtUI {

void onIdle() { ScreenHandler.loop(); }

void onPrinterKilled(PGM_P const error, PGM_P const component) {
ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, NUL_STR, GET_TEXT(MSG_PLEASE_RESET), true, true, true, true);
void onPrinterKilled(FSTR_P const error, FSTR_P const) {
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);
while (!ScreenHandler.loop()); // Wait while anything is left to be sent
}
Expand All @@ -60,7 +60,7 @@ namespace ExtUI {

void onUserConfirmRequired(const char * const 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.GotoScreen(DGUSLCD_SCREEN_POPUP);
}
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h
Expand Up @@ -38,6 +38,12 @@ class DGUSScreenHandler {
// 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.
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);

Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h
Expand Up @@ -38,6 +38,12 @@ class DGUSScreenHandler {
// 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.
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);

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp
Expand Up @@ -1233,7 +1233,7 @@ void DGUSScreenHandler::MKS_FilamentLoadUnload(DGUS_VP_Variable &var, void *val_
#if BOTH(HAS_HOTEND, PREVENT_COLD_EXTRUSION)
if (hotend_too_cold) {
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);
GotoScreen(DGUSLCD_SCREEN_POPUP);
}
Expand Down Expand Up @@ -1489,7 +1489,7 @@ void DGUSScreenHandler::DGUS_Runout_Idle(void) {
queue.inject(F("M25"));
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);
GotoScreen(DGUSLCD_SCREEN_POPUP);
break;
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h
Expand Up @@ -38,6 +38,12 @@ class DGUSScreenHandler {
// 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.
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);

Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h
Expand Up @@ -38,6 +38,12 @@ class DGUSScreenHandler {
// 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.
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);

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp
Expand Up @@ -159,9 +159,9 @@ void DGUSScreenHandler::Loop() {
dgus_display.Loop();
}

void DGUSScreenHandler::PrinterKilled(PGM_P error, PGM_P component) {
SetMessageLinePGM(error, 1);
SetMessageLinePGM(component, 2);
void DGUSScreenHandler::PrinterKilled(FSTR_P const error, FSTR_P const component) {
SetMessageLinePGM(FTOP(error), 1);
SetMessageLinePGM(FTOP(component), 2);
SetMessageLinePGM(NUL_STR, 3);
SetMessageLinePGM(GET_TEXT(MSG_PLEASE_RESET), 4);

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h
Expand Up @@ -37,7 +37,7 @@ class DGUSScreenHandler {
static void Ready();
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 SettingsReset();
static void StoreSettings(char *buff);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/example/example.cpp
Expand Up @@ -46,7 +46,7 @@ namespace ExtUI {
*/
}
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 onMediaError() {}
void onMediaRemoved() {}
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp
Expand Up @@ -38,9 +38,9 @@ namespace ExtUI {

void onIdle() { EventLoop::loop(); }

void onPrinterKilled(PGM_P const error, PGM_P const component) {
char str[strlen_P(error) + strlen_P(component) + 3];
sprintf_P(str, PSTR(S_FMT ": " S_FMT), error, component);
void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
char str[strlen_P(FTOP(error)) + strlen_P(FTOP(component)) + 3];
sprintf_P(str, PSTR(S_FMT ": " S_FMT), FTOP(error), FTOP(component));
KillScreen::show(str);
}

Expand Down

0 comments on commit 3d102a7

Please sign in to comment.