From 59503c6bbbcea81dcbe3e5ffa9ac175a01e7a2dc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Sep 2021 05:59:03 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Apply=20F()=20to=20E3V2=20titles?= =?UTF-8?q?,=20popups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/lcd/M0_M1.cpp | 5 +- Marlin/src/lcd/e3v2/common/dwin_api.h | 7 +- Marlin/src/lcd/e3v2/creality/dwin.cpp | 50 +- Marlin/src/lcd/e3v2/enhanced/dwin.cpp | 73 +-- Marlin/src/lcd/e3v2/enhanced/dwin.h | 30 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 642 +++++++++++++------------- Marlin/src/lcd/e3v2/jyersui/dwin.h | 6 +- 7 files changed, 428 insertions(+), 385 deletions(-) diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 9ba6ed5fc7..241f11c813 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -71,7 +71,10 @@ void GcodeSuite::M0_M1() { else ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT)); #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - DWIN_Popup_Confirm(ICON_BLTouch, parser.string_arg ?: GET_TEXT(MSG_STOPPED), GET_TEXT(MSG_USERWAIT)); + if (parser.string_arg) + DWIN_Popup_Confirm(ICON_BLTouch, parser.string_arg, GET_TEXT_F(MSG_USERWAIT)); + else + DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT)); #else if (parser.string_arg) { diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.h b/Marlin/src/lcd/e3v2/common/dwin_api.h index aea13aa621..37b1525ba3 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.h +++ b/Marlin/src/lcd/e3v2/common/dwin_api.h @@ -175,9 +175,10 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis, // rlimit: For draw less chars than string length use rlimit void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit=0xFFFF); -inline void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, FSTR_P title) { - // Note that this won't work on AVR, only 32-bit systems! - DWIN_Draw_String(bShow, size, color, bColor, x, y, FTOP(title)); +inline void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, FSTR_P const ftitle) { + char ctitle[strlen_P(FTOP(ftitle)) + 1]; + strcpy_P(ctitle, FTOP(ftitle)); + DWIN_Draw_String(bShow, size, color, bColor, x, y, ctitle); } // Draw a positive integer diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 006ff5db26..54fa6f941b 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -359,12 +359,8 @@ inline void Clear_Title_Bar() { DWIN_Draw_Box(1, Color_Bg_Blue, 0, 0, DWIN_WIDTH, TITLE_HEIGHT); } -void Draw_Title(const char * const title) { - DWIN_Draw_String(false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, (char*)title); -} - -void Draw_Title(FSTR_P title) { - DWIN_Draw_String(false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, (char*)title); +void Draw_Title(FSTR_P ftitle) { + DWIN_Draw_String(false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, ftitle); } inline void Clear_Menu_Area() { @@ -420,18 +416,25 @@ inline uint16_t nr_sd_menu_items() { return card.get_num_Files() + !card.flag.workDirIsRoot; } +void Erase_Menu_Text(const uint8_t line) { + DWIN_Draw_Rectangle(1, Color_Bg_Black, LBLX, MBASE(line) - 14, 271, MBASE(line) + 28); +} + void Draw_Menu_Icon(const uint8_t line, const uint8_t icon) { DWIN_ICON_Show(ICON, icon, 26, MBASE(line) - 3); } -void Erase_Menu_Text(const uint8_t line) { - DWIN_Draw_Rectangle(1, Color_Bg_Black, LBLX, MBASE(line) - 14, 271, MBASE(line) + 28); +void _Decorate_Menu_Item(const uint8_t line, const uint8_t icon, bool more) { + if (icon) Draw_Menu_Icon(line, icon); + if (more) Draw_More_Icon(line); } - void Draw_Menu_Item(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false) { if (label) DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(line) - 1, (char*)label); - if (icon) Draw_Menu_Icon(line, icon); - if (more) Draw_More_Icon(line); + _Decorate_Menu_Item(line, icon, more); +} +void Draw_Menu_Item(const uint8_t line, const uint8_t icon=0, FSTR_P const flabel=nullptr, bool more=false) { + if (flabel) DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(line) - 1, flabel); + _Decorate_Menu_Item(line, icon, more); } void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false) { @@ -439,13 +442,14 @@ void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const DWIN_Draw_Line(Line_Color, 16, MBASE(line) + 33, 256, MBASE(line) + 34); } -void Draw_Menu_LineF(const uint8_t line, const uint8_t icon=0, FSTR_P label=nullptr, bool more=false) { - Draw_Menu_Line(line, icon, (char*)label, more); +void Draw_Menu_Line(const uint8_t line, const uint8_t icon, FSTR_P const flabel, bool more=false) { + Draw_Menu_Item(line, icon, flabel, more); + DWIN_Draw_Line(Line_Color, 16, MBASE(line) + 33, 256, MBASE(line) + 34); } void Draw_Checkbox_Line(const uint8_t line, const bool ison) { const uint16_t x = 225, y = EBASE(line) - 2; - DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, x + 5, y, F(ison ? "X" : " ")); + DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, x + 5, y, ison ? F("X") : F(" ")); DWIN_Draw_Rectangle(0, Color_White, x + 2, y + 2, x + 16, y + 16); } @@ -1853,7 +1857,7 @@ void Draw_SDItem(const uint16_t item, int16_t row=-1) { if (row < 0) row = item + 1 + MROWS - index_file; const bool is_subdir = !card.flag.workDirIsRoot; if (is_subdir && item == 0) { - Draw_Menu_Line(row, ICON_Folder, ".."); + Draw_Menu_Line(row, ICON_Folder, F("..")); return; } @@ -2531,7 +2535,7 @@ void Item_HomeOffs_X(const uint8_t row) { } else { #ifdef USE_STRING_TITLES - Draw_Menu_LineF(row, ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X)); + Draw_Menu_Line(row, ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X)); #else say_home_offs_en(row); say_x_en(75, row); // "Home Offset X" #endif @@ -2546,7 +2550,7 @@ void Item_HomeOffs_Y(const uint8_t row) { } else { #ifdef USE_STRING_TITLES - Draw_Menu_LineF(row, ICON_HomeOffsetY, GET_TEXT_F(MSG_HOME_OFFSET_Y)); + Draw_Menu_Line(row, ICON_HomeOffsetY, GET_TEXT_F(MSG_HOME_OFFSET_Y)); #else say_home_offs_en(row); say_y_en(75, row); // "Home Offset X" #endif @@ -2561,7 +2565,7 @@ void Item_HomeOffs_Z(const uint8_t row) { } else { #ifdef USE_STRING_TITLES - Draw_Menu_LineF(row, ICON_HomeOffsetZ, GET_TEXT_F(MSG_HOME_OFFSET_Z)); + Draw_Menu_Line(row, ICON_HomeOffsetZ, GET_TEXT_F(MSG_HOME_OFFSET_Z)); #else say_home_offs_en(row); say_z_en(75, row); // "Home Offset Z" #endif @@ -2604,8 +2608,8 @@ void Draw_HomeOff_Menu() { DWIN_Frame_TitleCopy(124, 431, 91, 12); // "Probe Offsets" #endif #ifdef USE_STRING_TITLES - Draw_Menu_LineF(1, ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET)); // Probe X Offset - Draw_Menu_LineF(2, ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET)); // Probe Y Offset + Draw_Menu_Line(1, ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET)); // Probe X Offset + Draw_Menu_Line(2, ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET)); // Probe Y Offset #else say_probe_offs_en(1); say_x_en(75, 1); // "Probe Offset X" say_probe_offs_en(2); say_y_en(75, 2); // "Probe Offset Y" @@ -3090,7 +3094,7 @@ void HMI_Temperature() { } else { #ifdef USE_STRING_HEADINGS - Draw_Title(PREHEAT_1_LABEL " Settings"); // TODO: GET_TEXT_F + Draw_Title(F(PREHEAT_1_LABEL " Settings")); // TODO: GET_TEXT_F #else DWIN_Frame_TitleCopy(56, 15, 85, 14); // "Temperature" TODO: "PLA Settings" #endif @@ -3169,7 +3173,7 @@ void HMI_Temperature() { } else { #ifdef USE_STRING_HEADINGS - Draw_Title("ABS Settings"); // TODO: GET_TEXT_F + Draw_Title(F("ABS Settings")); // TODO: GET_TEXT_F #else DWIN_Frame_TitleCopy(56, 15, 85, 14); // "Temperature" TODO: "ABS Settings" #endif @@ -3252,7 +3256,7 @@ void Draw_Max_Speed_Menu() { } else { #ifdef USE_STRING_HEADINGS - Draw_Title("Max Speed (mm/s)"); // TODO: GET_TEXT_F + Draw_Title(F("Max Speed (mm/s)")); // TODO: GET_TEXT_F #else DWIN_Frame_TitleCopy(144, 16, 46, 11); // "Max Speed (mm/s)" #endif diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp index 8bb5a155ee..81b83a0562 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp @@ -486,24 +486,31 @@ void Clear_Popup_Area() { DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 31, DWIN_WIDTH, DWIN_HEIGHT); } -void DWIN_Draw_Popup(uint8_t icon=0, const char * const msg1=nullptr, const char * const msg2=nullptr, uint8_t button=0) { +void DWIN_Draw_Popup1(const uint8_t icon) { DWINUI::ClearMenuArea(); Draw_Popup_Bkgd_60(); if (icon) DWINUI::Draw_Icon(icon, 101, 105); - if (msg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, msg1); - if (msg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, msg2); +} +void DWIN_Draw_Popup2(FSTR_P const fmsg2, uint8_t button) { + if (fmsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, fmsg2); if (button) DWINUI::Draw_Icon(button, 86, 280); } -void DWIN_Popup_Confirm(uint8_t icon, const char * const msg1, const char * const msg2) { - HMI_SaveProcessID(WaitResponse); - DWIN_Draw_Popup(icon, msg1, msg2, ICON_Confirm_E); // Button Confirm - DWIN_UpdateLCD(); +void DWIN_Draw_Popup(const uint8_t icon, const char * const cmsg1, FSTR_P const fmsg2, uint8_t button) { + DWIN_Draw_Popup1(icon); + if (cmsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, cmsg1); + DWIN_Draw_Popup2(fmsg2, button); +} + +void DWIN_Draw_Popup(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2, uint8_t button) { + DWIN_Draw_Popup1(icon); + if (fmsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, fmsg1); + DWIN_Draw_Popup2(fmsg2, button); } -void DWIN_Popup_Continue(uint8_t icon, const char * const msg1, const char * const msg2) { +void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2) { HMI_SaveProcessID(WaitResponse); - DWIN_Draw_Popup(icon, msg1, msg2, ICON_Continue_E); // Button Continue + DWIN_Draw_Popup(icon, fmsg1, fmsg2, ICON_Continue_E); // Button Continue DWIN_UpdateLCD(); } @@ -521,7 +528,7 @@ void DWIN_Popup_Continue(uint8_t icon, const char * const msg1, const char * con DWIN_UpdateLCD(); } else - DWIN_Popup_Confirm(ICON_TempTooLow, "Nozzle is too cold", "Preheat the hotend"); + DWIN_Popup_Confirm(ICON_TempTooLow, F("Nozzle is too cold"), F("Preheat the hotend")); } #endif @@ -565,7 +572,7 @@ void Popup_window_PauseOrStop() { DWINUI::Draw_Icon(ICON_Cancel_C, 146, 280); } else { - DWIN_Draw_Popup(ICON_BLTouch, "Please confirm", select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT(MSG_PAUSE_PRINT) : GET_TEXT(MSG_STOP_PRINT)); + DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT)); DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280); } @@ -1386,7 +1393,7 @@ void HMI_PauseOrStop() { #ifdef ACTION_ON_CANCEL host_action_cancel(); #endif - DWIN_Draw_Popup(ICON_BLTouch, "Stopping..." , "Please wait until done."); + DWIN_Draw_Popup(ICON_BLTouch, F("Stopping...") , F("Please wait until done.")); } else Goto_PrintProcess(); // cancel stop @@ -1644,7 +1651,7 @@ void HMI_SaveProcessID(const uint8_t id) { void DWIN_StartHoming() { HMI_flag.home_flag = true; HMI_SaveProcessID(Homing); - DWIN_Draw_Popup(ICON_BLTouch, "Axis Homing", "Please wait until done."); + DWIN_Draw_Popup(ICON_BLTouch, F("Axis Homing"), F("Please wait until done.")); } void DWIN_CompletedHoming() { @@ -1659,7 +1666,7 @@ void DWIN_CompletedHoming() { void DWIN_MeshLevelingStart() { #if HAS_ONESTEP_LEVELING HMI_SaveProcessID(Leveling); - DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT(MSG_BED_LEVELING), "Please wait until done."); + DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), F("Please wait until done.")); #elif ENABLED(MESH_BED_LEVELING) Draw_ManualMesh_Menu(); #endif @@ -1682,27 +1689,27 @@ void DWIN_PidTuning(pidresult_t result) { switch (result) { case PID_BED_START: HMI_SaveProcessID(NothingToDo); - DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT(MSG_PID_AUTOTUNE), "for BED is running."); + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); break; case PID_EXTR_START: HMI_SaveProcessID(NothingToDo); - DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT(MSG_PID_AUTOTUNE), "for Nozzle is running."); + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); break; case PID_BAD_EXTRUDER_NUM: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooLow, "PID Autotune failed!", "Bad extruder"); + DWIN_Popup_Confirm(ICON_TempTooLow, F("PID Autotune failed!"), F("Bad extruder")); break; case PID_TUNING_TIMEOUT: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, "Error", GET_TEXT(MSG_PID_TIMEOUT)); + DWIN_Popup_Confirm(ICON_TempTooHigh, F("Error"), GET_TEXT_F(MSG_PID_TIMEOUT)); break; case PID_TEMP_TOO_HIGH: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, "PID Autotune failed!", "Temperature too high"); + DWIN_Popup_Confirm(ICON_TempTooHigh, F("PID Autotune failed!"), F("Temperature too high")); break; case PID_DONE: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT(MSG_PID_AUTOTUNE), GET_TEXT(MSG_BUTTON_DONE)); + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE)); break; default: checkkey = last_checkkey; @@ -1864,24 +1871,24 @@ void DWIN_Redraw_screen() { #if ENABLED(ADVANCED_PAUSE_FEATURE) - void DWIN_Popup_Pause(const char *msg, uint8_t button = 0) { + void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button = 0) { HMI_SaveProcessID(button ? WaitResponse : NothingToDo); - DWIN_Draw_Popup(ICON_BLTouch, "Advanced Pause", msg, button); + DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), fmsg, button); ui.reset_status(true); } void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) { switch (message) { - case PAUSE_MESSAGE_PARKING: DWIN_Popup_Pause(GET_TEXT(MSG_PAUSE_PRINT_PARKING)); break; - case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_INIT)); break; - case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD)); break; - case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING), ICON_Continue_E); break; - case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, "Advanced Pause", GET_TEXT(MSG_FILAMENT_CHANGE_INSERT)); break; - case PAUSE_MESSAGE_LOAD: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_PURGE: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE)); break; + case PAUSE_MESSAGE_PARKING: DWIN_Popup_Pause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; + case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; + case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; + case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), ICON_Continue_E); break; + case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, F("Advanced Pause"), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; + case PAUSE_MESSAGE_LOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; + case PAUSE_MESSAGE_PURGE: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)); break; case PAUSE_MESSAGE_OPTION: DWIN_Popup_FilamentPurge(); break; - case PAUSE_MESSAGE_RESUME: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME)); break; - case PAUSE_MESSAGE_HEAT: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT), ICON_Continue_E); break; + case PAUSE_MESSAGE_RESUME: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; + case PAUSE_MESSAGE_HEAT: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), ICON_Continue_E); break; case PAUSE_MESSAGE_HEATING: ui.set_status_P(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); break; case PAUSE_MESSAGE_STATUS: HMI_ReturnScreen(); break; default: break; @@ -1889,7 +1896,7 @@ void DWIN_Redraw_screen() { } void Draw_Popup_FilamentPurge() { - DWIN_Draw_Popup(ICON_BLTouch, "Advanced Pause", "Purge or Continue?"); + DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), F("Purge or Continue?")); DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); Draw_Select_Highlight(true); @@ -1928,7 +1935,7 @@ void DWIN_Redraw_screen() { #if HAS_MESH void DWIN_MeshViewer() { if (!leveling_is_valid()) - DWIN_Popup_Continue(ICON_BLTouch, "Mesh viewer", "No valid mesh"); + DWIN_Popup_Continue(ICON_BLTouch, F("Mesh viewer"), F("No valid mesh")); else { HMI_SaveProcessID(WaitResponse); MeshViewer.Draw(); diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.h b/Marlin/src/lcd/e3v2/enhanced/dwin.h index 6b131592a8..f71d54b482 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.h @@ -152,16 +152,6 @@ extern HMI_data_t HMI_data; extern uint8_t checkkey; extern millis_t dwin_heat_time; -// Popup windows -void DWIN_Popup_Confirm(uint8_t icon, const char * const msg1, const char * const msg2); -#if HAS_HOTEND || HAS_HEATED_BED - void DWIN_Popup_Temperature(const bool toohigh); -#endif -#if HAS_HOTEND - void Popup_Window_ETempTooLow(); -#endif -void Popup_Window_Resume(); - // SD Card void HMI_SDCardInit(); void HMI_SDCardUpdate(); @@ -278,3 +268,23 @@ void Draw_Steps_Menu(); #if EITHER(HAS_BED_PROBE, BABYSTEPPING) void Draw_ZOffsetWiz_Menu(); #endif + +// Popup windows + +void DWIN_Draw_Popup(const uint8_t icon, const char * const cmsg1, FSTR_P const fmsg2, uint8_t button=0); +void DWIN_Draw_Popup(const uint8_t icon, FSTR_P const fmsg1=nullptr, FSTR_P const fmsg2=nullptr, uint8_t button=0); + +template +void DWIN_Popup_Confirm(const uint8_t icon, T amsg1, U amsg2) { + HMI_SaveProcessID(WaitResponse); + DWIN_Draw_Popup(icon, amsg1, amsg2, ICON_Confirm_E); // Button Confirm + DWIN_UpdateLCD(); +} + +#if HAS_HOTEND || HAS_HEATED_BED + void DWIN_Popup_Temperature(const bool toohigh); +#endif +#if HAS_HOTEND + void Popup_Window_ETempTooLow(); +#endif +void Popup_Window_Resume(); diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index b2b8450316..9f50b2f287 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -470,19 +470,35 @@ uint16_t CrealityDWINClass::GetColor(uint8_t color, uint16_t original, bool ligh return Color_White; } -void CrealityDWINClass::Draw_Title(const char * title) { - DWIN_Draw_String(false, DWIN_FONT_HEAD, GetColor(eeprom_settings.menu_top_txt, Color_White, false), Color_Bg_Blue, (DWIN_WIDTH - strlen(title) * STAT_CHR_W) / 2, 5, title); +void CrealityDWINClass::Draw_Title(const char * ctitle) { + DWIN_Draw_String(false, DWIN_FONT_HEAD, GetColor(eeprom_settings.menu_top_txt, Color_White, false), Color_Bg_Blue, (DWIN_WIDTH - strlen(ctitle) * STAT_CHR_W) / 2, 5, ctitle); +} +void CrealityDWINClass::Draw_Title(FSTR_P const ftitle) { + DWIN_Draw_String(false, DWIN_FONT_HEAD, GetColor(eeprom_settings.menu_top_txt, Color_White, false), Color_Bg_Blue, (DWIN_WIDTH - strlen_P(FTOP(ftitle)) * STAT_CHR_W) / 2, 5, ftitle); +} + +void _Decorate_Menu_Item(uint8_t row, uint8_t icon, bool more) { + if (icon) DWIN_ICON_Show(ICON, icon, 26, MBASE(row) - 3); //Draw Menu Icon + if (more) DWIN_ICON_Show(ICON, ICON_More, 226, MBASE(row) - 3); // Draw More Arrow + DWIN_Draw_Line(CrealityDWIN.GetColor(CrealityDWIN.eeprom_settings.menu_split_line, Line_Color, true), 16, MBASE(row) + 33, 256, MBASE(row) + 33); // Draw Menu Line } void CrealityDWINClass::Draw_Menu_Item(uint8_t row, uint8_t icon/*=0*/, const char * label1, const char * label2, bool more/*=false*/, bool centered/*=false*/) { - const uint8_t label_offset_y = !(label1 && label2) ? 0 : MENU_CHR_H * 3 / 5; - const uint8_t label1_offset_x = !centered ? LBLX : LBLX * 4/5 + _MAX(LBLX * 1U/5, (DWIN_WIDTH - LBLX - (label1 ? strlen(label1) : 0) * MENU_CHR_W) / 2); - const uint8_t label2_offset_x = !centered ? LBLX : LBLX * 4/5 + _MAX(LBLX * 1U/5, (DWIN_WIDTH - LBLX - (label2 ? strlen(label2) : 0) * MENU_CHR_W) / 2); + const uint8_t label_offset_y = (label1 || label2) ? MENU_CHR_H * 3 / 5 : 0, + label1_offset_x = !centered ? LBLX : LBLX * 4/5 + _MAX(LBLX * 1U/5, (DWIN_WIDTH - LBLX - (label1 ? strlen(label1) : 0) * MENU_CHR_W) / 2), + label2_offset_x = !centered ? LBLX : LBLX * 4/5 + _MAX(LBLX * 1U/5, (DWIN_WIDTH - LBLX - (label2 ? strlen(label2) : 0) * MENU_CHR_W) / 2); if (label1) DWIN_Draw_String(false, DWIN_FONT_MENU, Color_White, Color_Bg_Black, label1_offset_x, MBASE(row) - 1 - label_offset_y, label1); // Draw Label if (label2) DWIN_Draw_String(false, DWIN_FONT_MENU, Color_White, Color_Bg_Black, label2_offset_x, MBASE(row) - 1 + label_offset_y, label2); // Draw Label - if (icon) DWIN_ICON_Show(ICON, icon, 26, MBASE(row) - 3); //Draw Menu Icon - if (more) DWIN_ICON_Show(ICON, ICON_More, 226, MBASE(row) - 3); // Draw More Arrow - DWIN_Draw_Line(GetColor(eeprom_settings.menu_split_line, Line_Color, true), 16, MBASE(row) + 33, 256, MBASE(row) + 33); // Draw Menu Line + _Decorate_Menu_Item(row, icon, more); +} + +void CrealityDWINClass::Draw_Menu_Item(uint8_t row, uint8_t icon/*=0*/, FSTR_P const flabel1, FSTR_P const flabel2, bool more/*=false*/, bool centered/*=false*/) { + const uint8_t label_offset_y = (flabel1 || flabel2) ? MENU_CHR_H * 3 / 5 : 0, + label1_offset_x = !centered ? LBLX : LBLX * 4/5 + _MAX(LBLX * 1U/5, (DWIN_WIDTH - LBLX - (flabel1 ? strlen_P(FTOP(flabel1)) : 0) * MENU_CHR_W) / 2), + label2_offset_x = !centered ? LBLX : LBLX * 4/5 + _MAX(LBLX * 1U/5, (DWIN_WIDTH - LBLX - (flabel2 ? strlen_P(FTOP(flabel2)) : 0) * MENU_CHR_W) / 2); + if (flabel1) DWIN_Draw_String(false, DWIN_FONT_MENU, Color_White, Color_Bg_Black, label1_offset_x, MBASE(row) - 1 - label_offset_y, flabel1); // Draw Label + if (flabel2) DWIN_Draw_String(false, DWIN_FONT_MENU, Color_White, Color_Bg_Black, label2_offset_x, MBASE(row) - 1 + label_offset_y, flabel2); // Draw Label + _Decorate_Menu_Item(row, icon, more); } void CrealityDWINClass::Draw_Checkbox(uint8_t row, bool value) { @@ -742,7 +758,7 @@ void CrealityDWINClass::Draw_Print_confirm() { void CrealityDWINClass::Draw_SD_Item(uint8_t item, uint8_t row) { if (item == 0) - Draw_Menu_Item(0, ICON_Back, card.flag.workDirIsRoot ? "Back" : ".."); + Draw_Menu_Item(0, ICON_Back, card.flag.workDirIsRoot ? F("Back") : F("..")); else { card.getfilename_sorted(SD_ORDER(item - 1, card.get_num_Files())); char * const filename = card.longest_filename(); @@ -772,7 +788,7 @@ void CrealityDWINClass::Draw_SD_List(bool removed/*=false*/) { Draw_SD_Item(i, i); } else { - Draw_Menu_Item(0, ICON_Back, "Back"); + Draw_Menu_Item(0, ICON_Back, F("Back")); DWIN_Draw_Rectangle(1, Color_Bg_Red, 10, MBASE(3) - 10, DWIN_WIDTH - 10, MBASE(4)); DWIN_Draw_String(false, font16x32, Color_Yellow, Color_Bg_Red, ((DWIN_WIDTH) - 8 * 16) / 2, MBASE(3), F("No Media")); } @@ -907,7 +923,7 @@ void CrealityDWINClass::Draw_Status_Area(bool icons/*=false*/) { DWIN_UpdateLCD(); } -void CrealityDWINClass::Draw_Popup(PGM_P const line1, PGM_P const line2, PGM_P const line3, uint8_t mode, uint8_t icon/*=0*/) { +void CrealityDWINClass::Draw_Popup(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, uint8_t mode, uint8_t icon/*=0*/) { if (process != Confirm && process != Popup && process != Wait) last_process = process; if ((process == Menu || process == Wait) && mode == Popup) last_selection = selection; process = mode; @@ -916,9 +932,9 @@ void CrealityDWINClass::Draw_Popup(PGM_P const line1, PGM_P const line2, PGM_P c DWIN_Draw_Rectangle(1, Color_Bg_Window, 14, 60, 258, 350); const uint8_t ypos = (mode == Popup || mode == Confirm) ? 150 : 230; if (icon > 0) DWIN_ICON_Show(ICON, icon, 101, 105); - DWIN_Draw_String(true, DWIN_FONT_MENU, Popup_Text_Color, Color_Bg_Window, (272 - 8 * strlen_P(line1)) / 2, ypos, line1); - DWIN_Draw_String(true, DWIN_FONT_MENU, Popup_Text_Color, Color_Bg_Window, (272 - 8 * strlen_P(line2)) / 2, ypos + 30, line2); - DWIN_Draw_String(true, DWIN_FONT_MENU, Popup_Text_Color, Color_Bg_Window, (272 - 8 * strlen_P(line3)) / 2, ypos + 60, line3); + DWIN_Draw_String(true, DWIN_FONT_MENU, Popup_Text_Color, Color_Bg_Window, (272 - 8 * strlen_P(FTOP(line1))) / 2, ypos, line1); + DWIN_Draw_String(true, DWIN_FONT_MENU, Popup_Text_Color, Color_Bg_Window, (272 - 8 * strlen_P(FTOP(line2))) / 2, ypos + 30, line2); + DWIN_Draw_String(true, DWIN_FONT_MENU, Popup_Text_Color, Color_Bg_Window, (272 - 8 * strlen_P(FTOP(line3))) / 2, ypos + 60, line3); if (mode == Popup) { selection = 0; DWIN_Draw_Rectangle(1, Confirm_Color, 26, 280, 125, 317); @@ -934,7 +950,7 @@ void CrealityDWINClass::Draw_Popup(PGM_P const line1, PGM_P const line2, PGM_P c } void MarlinUI::kill_screen(PGM_P const error, PGM_P const component) { - CrealityDWIN.Draw_Popup(PSTR("Printer Kill Reason:"), error, PSTR("Restart Required"), Wait, ICON_BLTouch); + CrealityDWIN.Draw_Popup(F("Printer Kill Reason:"), error, F("Restart Required"), Wait, ICON_BLTouch); } void CrealityDWINClass::Popup_Select() { @@ -1025,31 +1041,31 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PREPARE_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Main_Menu(1); break; case PREPARE_MOVE: if (draw) - Draw_Menu_Item(row, ICON_Axis, "Move", nullptr, true); + Draw_Menu_Item(row, ICON_Axis, F("Move"), nullptr, true); else Draw_Menu(Move); break; case PREPARE_DISABLE: if (draw) - Draw_Menu_Item(row, ICON_CloseMotor, "Disable Stepper"); + Draw_Menu_Item(row, ICON_CloseMotor, F("Disable Stepper")); else queue.inject_P(PSTR("M84")); break; case PREPARE_HOME: if (draw) - Draw_Menu_Item(row, ICON_SetHome, "Homing", nullptr, true); + Draw_Menu_Item(row, ICON_SetHome, F("Homing"), nullptr, true); else Draw_Menu(HomeMenu); break; case PREPARE_MANUALLEVEL: if (draw) - Draw_Menu_Item(row, ICON_PrintSize, "Manual Leveling", nullptr, true); + Draw_Menu_Item(row, ICON_PrintSize, F("Manual Leveling"), nullptr, true); else { if (axes_should_home()) { Popup_Handler(Home); @@ -1066,7 +1082,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_ZOFFSET_ITEM case PREPARE_ZOFFSET: if (draw) - Draw_Menu_Item(row, ICON_Zoffset, "Z-Offset", nullptr, true); + Draw_Menu_Item(row, ICON_Zoffset, F("Z-Offset"), nullptr, true); else { #if HAS_LEVELING level_state = planner.leveling_active; @@ -1080,13 +1096,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_PREHEAT case PREPARE_PREHEAT: if (draw) - Draw_Menu_Item(row, ICON_Temperature, "Preheat", nullptr, true); + Draw_Menu_Item(row, ICON_Temperature, F("Preheat"), nullptr, true); else Draw_Menu(Preheat); break; case PREPARE_COOLDOWN: if (draw) - Draw_Menu_Item(row, ICON_Cool, "Cooldown"); + Draw_Menu_Item(row, ICON_Cool, F("Cooldown")); else { TERN_(HAS_FAN, thermalManager.zero_fan_speeds()); thermalManager.disable_all_heaters(); @@ -1097,7 +1113,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(ADVANCED_PAUSE_FEATURE) case PREPARE_CHANGEFIL: if (draw) { - Draw_Menu_Item(row, ICON_ResumeEEPROM, "Change Filament" + Draw_Menu_Item(row, ICON_ResumeEEPROM, F("Change Filament") #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) , nullptr, true #endif @@ -1138,13 +1154,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case HOME_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Prepare, PREPARE_HOME); break; case HOME_ALL: if (draw) - Draw_Menu_Item(row, ICON_Homing, "Home All"); + Draw_Menu_Item(row, ICON_Homing, F("Home All")); else { Popup_Handler(Home); gcode.home_all_axes(true); @@ -1153,7 +1169,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case HOME_X: if (draw) - Draw_Menu_Item(row, ICON_MoveX, "Home X"); + Draw_Menu_Item(row, ICON_MoveX, F("Home X")); else { Popup_Handler(Home); gcode.process_subcommands_now_P(PSTR("G28 X")); @@ -1163,7 +1179,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case HOME_Y: if (draw) - Draw_Menu_Item(row, ICON_MoveY, "Home Y"); + Draw_Menu_Item(row, ICON_MoveY, F("Home Y")); else { Popup_Handler(Home); gcode.process_subcommands_now_P(PSTR("G28 Y")); @@ -1173,7 +1189,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case HOME_Z: if (draw) - Draw_Menu_Item(row, ICON_MoveZ,"Home Z"); + Draw_Menu_Item(row, ICON_MoveZ, F("Home Z")); else { Popup_Handler(Home); gcode.process_subcommands_now_P(PSTR("G28 Z")); @@ -1183,7 +1199,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case HOME_SET: if (draw) - Draw_Menu_Item(row, ICON_SetHome, "Set Home Position"); + Draw_Menu_Item(row, ICON_SetHome, F("Set Home Position")); else { gcode.process_subcommands_now_P(PSTR("G92 X0 Y0 Z0")); AudioFeedback(); @@ -1206,7 +1222,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case MOVE_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else { #if HAS_BED_PROBE probe_deployed = false; @@ -1217,7 +1233,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MOVE_X: if (draw) { - Draw_Menu_Item(row, ICON_MoveX, "Move X"); + Draw_Menu_Item(row, ICON_MoveX, F("Move X")); Draw_Float(current_position.x, row, false); } else @@ -1225,7 +1241,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MOVE_Y: if (draw) { - Draw_Menu_Item(row, ICON_MoveY, "Move Y"); + Draw_Menu_Item(row, ICON_MoveY, F("Move Y")); Draw_Float(current_position.y, row); } else @@ -1233,7 +1249,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MOVE_Z: if (draw) { - Draw_Menu_Item(row, ICON_MoveZ, "Move Z"); + Draw_Menu_Item(row, ICON_MoveZ, F("Move Z")); Draw_Float(current_position.z, row); } else @@ -1243,7 +1259,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HOTEND case MOVE_E: if (draw) { - Draw_Menu_Item(row, ICON_Extruder, "Extruder"); + Draw_Menu_Item(row, ICON_Extruder, F("Extruder")); current_position.e = 0; sync_plan_position(); Draw_Float(current_position.e, row); @@ -1269,7 +1285,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_BED_PROBE case MOVE_P: if (draw) { - Draw_Menu_Item(row, ICON_StockConfiguration, "Probe"); + Draw_Menu_Item(row, ICON_StockConfiguration, F("Probe")); Draw_Checkbox(row, probe_deployed); } else { @@ -1282,7 +1298,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case MOVE_LIVE: if (draw) { - Draw_Menu_Item(row, ICON_Axis, "Live Movement"); + Draw_Menu_Item(row, ICON_Axis, F("Live Movement")); Draw_Checkbox(row, livemove); } else { @@ -1310,7 +1326,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case MLEVEL_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else { TERN_(HAS_LEVELING, set_bed_leveling_enabled(level_state)); Draw_Menu(Prepare, PREPARE_MANUALLEVEL); @@ -1319,7 +1335,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_BED_PROBE case MLEVEL_PROBE: if (draw) { - Draw_Menu_Item(row, ICON_Zoffset, "Use Probe"); + Draw_Menu_Item(row, ICON_Zoffset, F("Use Probe")); Draw_Checkbox(row, use_probe); } else { @@ -1344,7 +1360,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #endif case MLEVEL_BL: if (draw) - Draw_Menu_Item(row, ICON_AxisBL, "Bottom Left"); + Draw_Menu_Item(row, ICON_AxisBL, F("Bottom Left")); else { Popup_Handler(MoveWait); if (use_probe) { @@ -1365,7 +1381,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MLEVEL_TL: if (draw) - Draw_Menu_Item(row, ICON_AxisTL, "Top Left"); + Draw_Menu_Item(row, ICON_AxisTL, F("Top Left")); else { Popup_Handler(MoveWait); if (use_probe) { @@ -1386,7 +1402,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MLEVEL_TR: if (draw) - Draw_Menu_Item(row, ICON_AxisTR, "Top Right"); + Draw_Menu_Item(row, ICON_AxisTR, F("Top Right")); else { Popup_Handler(MoveWait); if (use_probe) { @@ -1407,7 +1423,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MLEVEL_BR: if (draw) - Draw_Menu_Item(row, ICON_AxisBR, "Bottom Right"); + Draw_Menu_Item(row, ICON_AxisBR, F("Bottom Right")); else { Popup_Handler(MoveWait); if (use_probe) { @@ -1428,7 +1444,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MLEVEL_C: if (draw) - Draw_Menu_Item(row, ICON_AxisC, "Center"); + Draw_Menu_Item(row, ICON_AxisC, F("Center")); else { Popup_Handler(MoveWait); if (use_probe) { @@ -1449,7 +1465,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MLEVEL_ZPOS: if (draw) { - Draw_Menu_Item(row, ICON_SetZOffset, "Z Position"); + Draw_Menu_Item(row, ICON_SetZOffset, F("Z Position")); Draw_Float(mlev_z_pos, row, false, 100); } else @@ -1472,7 +1488,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case ZOFFSET_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else { liveadjust = false; TERN_(HAS_LEVELING, set_bed_leveling_enabled(level_state)); @@ -1481,7 +1497,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case ZOFFSET_HOME: if (draw) - Draw_Menu_Item(row, ICON_Homing, "Home Z Axis"); + Draw_Menu_Item(row, ICON_Homing, F("Home Z Axis")); else { Popup_Handler(Home); gcode.process_subcommands_now_P(PSTR("G28 Z")); @@ -1500,7 +1516,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case ZOFFSET_MODE: if (draw) { - Draw_Menu_Item(row, ICON_Zoffset, "Live Adjustment"); + Draw_Menu_Item(row, ICON_Zoffset, F("Live Adjustment")); Draw_Checkbox(row, liveadjust); } else { @@ -1527,7 +1543,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case ZOFFSET_OFFSET: if (draw) { - Draw_Menu_Item(row, ICON_SetZOffset, "Z Offset"); + Draw_Menu_Item(row, ICON_SetZOffset, F("Z Offset")); Draw_Float(zoffsetvalue, row, false, 100); } else @@ -1535,7 +1551,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case ZOFFSET_UP: if (draw) - Draw_Menu_Item(row, ICON_Axis, "Microstep Up"); + Draw_Menu_Item(row, ICON_Axis, F("Microstep Up")); else { if (zoffsetvalue < MAX_Z_OFFSET) { if (liveadjust) { @@ -1549,7 +1565,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case ZOFFSET_DOWN: if (draw) - Draw_Menu_Item(row, ICON_AxisD, "Microstep Down"); + Draw_Menu_Item(row, ICON_AxisD, F("Microstep Down")); else { if (zoffsetvalue > MIN_Z_OFFSET) { if (liveadjust) { @@ -1564,7 +1580,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(EEPROM_SETTINGS) case ZOFFSET_SAVE: if (draw) - Draw_Menu_Item(row, ICON_WriteEEPROM, "Save"); + Draw_Menu_Item(row, ICON_WriteEEPROM, F("Save")); else AudioFeedback(settings.save()); break; @@ -1587,13 +1603,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PREHEAT_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Prepare, PREPARE_PREHEAT); break; case PREHEAT_MODE: if (draw) { - Draw_Menu_Item(row, ICON_Homing, "Preheat Mode"); + Draw_Menu_Item(row, ICON_Homing, F("Preheat Mode")); Draw_Option(preheatmode, preheat_modes, row); } else @@ -1603,7 +1619,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 1 case PREHEAT_1: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_1_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL)); else { thermalManager.disable_all_heaters(); TERN_(HAS_FAN, thermalManager.zero_fan_speeds()); @@ -1621,7 +1637,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 2 case PREHEAT_2: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_2_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL)); else { thermalManager.disable_all_heaters(); TERN_(HAS_FAN, thermalManager.zero_fan_speeds()); @@ -1639,7 +1655,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 3 case PREHEAT_3: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_3_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL)); else { thermalManager.disable_all_heaters(); TERN_(HAS_FAN, thermalManager.zero_fan_speeds()); @@ -1657,7 +1673,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 4 case PREHEAT_4: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_4_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL)); else { thermalManager.disable_all_heaters(); TERN_(HAS_FAN, thermalManager.zero_fan_speeds()); @@ -1675,7 +1691,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 5 case PREHEAT_5: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_5_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL)); else { thermalManager.disable_all_heaters(); TERN_(HAS_FAN, thermalManager.zero_fan_speeds()); @@ -1705,13 +1721,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case CHANGEFIL_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Prepare, PREPARE_CHANGEFIL); break; case CHANGEFIL_LOAD: if (draw) - Draw_Menu_Item(row, ICON_WriteEEPROM, "Load Filament"); + Draw_Menu_Item(row, ICON_WriteEEPROM, F("Load Filament")); else { if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) Popup_Handler(ETemp); @@ -1729,7 +1745,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case CHANGEFIL_UNLOAD: if (draw) - Draw_Menu_Item(row, ICON_ReadEEPROM, "Unload Filament"); + Draw_Menu_Item(row, ICON_ReadEEPROM, F("Unload Filament")); else { if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) { Popup_Handler(ETemp); @@ -1748,7 +1764,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case CHANGEFIL_CHANGE: if (draw) - Draw_Menu_Item(row, ICON_ResumeEEPROM, "Change Filament"); + Draw_Menu_Item(row, ICON_ResumeEEPROM, F("Change Filament")); else { if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) Popup_Handler(ETemp); @@ -1783,50 +1799,50 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case CONTROL_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Main_Menu(2); break; case CONTROL_TEMP: if (draw) - Draw_Menu_Item(row, ICON_Temperature, "Temperature", nullptr, true); + Draw_Menu_Item(row, ICON_Temperature, F("Temperature"), nullptr, true); else Draw_Menu(TempMenu); break; case CONTROL_MOTION: if (draw) - Draw_Menu_Item(row, ICON_Motion, "Motion", nullptr, true); + Draw_Menu_Item(row, ICON_Motion, F("Motion"), nullptr, true); else Draw_Menu(Motion); break; case CONTROL_VISUAL: if (draw) - Draw_Menu_Item(row, ICON_PrintSize, "Visual", nullptr, true); + Draw_Menu_Item(row, ICON_PrintSize, F("Visual"), nullptr, true); else Draw_Menu(Visual); break; case CONTROL_ADVANCED: if (draw) - Draw_Menu_Item(row, ICON_Version, "Advanced", nullptr, true); + Draw_Menu_Item(row, ICON_Version, F("Advanced"), nullptr, true); else Draw_Menu(Advanced); break; #if ENABLED(EEPROM_SETTINGS) case CONTROL_SAVE: if (draw) - Draw_Menu_Item(row, ICON_WriteEEPROM, "Store Settings"); + Draw_Menu_Item(row, ICON_WriteEEPROM, F("Store Settings")); else AudioFeedback(settings.save()); break; case CONTROL_RESTORE: if (draw) - Draw_Menu_Item(row, ICON_ReadEEPROM, "Restore Settings"); + Draw_Menu_Item(row, ICON_ReadEEPROM, F("Restore Settings")); else AudioFeedback(settings.load()); break; case CONTROL_RESET: if (draw) - Draw_Menu_Item(row, ICON_Temperature, "Reset to Defaults"); + Draw_Menu_Item(row, ICON_Temperature, F("Reset to Defaults")); else { settings.reset(); AudioFeedback(); @@ -1835,7 +1851,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #endif case CONTROL_INFO: if (draw) - Draw_Menu_Item(row, ICON_Info, "Info"); + Draw_Menu_Item(row, ICON_Info, F("Info")); else Draw_Menu(Info); break; @@ -1859,14 +1875,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case TEMP_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Control, CONTROL_TEMP); break; #if HAS_HOTEND case TEMP_HOTEND: if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, "Hotend"); + Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); Draw_Float(thermalManager.temp_hotend[0].target, row, false, 1); } else @@ -1876,7 +1892,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HEATED_BED case TEMP_BED: if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, "Bed"); + Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); Draw_Float(thermalManager.temp_bed.target, row, false, 1); } else @@ -1886,7 +1902,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_FAN case TEMP_FAN: if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, "Fan"); + Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); Draw_Float(thermalManager.fan_speed[0], row, false, 1); } else @@ -1896,7 +1912,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HOTEND || HAS_HEATED_BED case TEMP_PID: if (draw) - Draw_Menu_Item(row, ICON_Step, "PID", nullptr, true); + Draw_Menu_Item(row, ICON_Step, F("PID"), nullptr, true); else Draw_Menu(PID); break; @@ -1904,7 +1920,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 1 case TEMP_PREHEAT1: if (draw) - Draw_Menu_Item(row, ICON_Step, PREHEAT_1_LABEL, nullptr, true); + Draw_Menu_Item(row, ICON_Step, F(PREHEAT_1_LABEL), nullptr, true); else Draw_Menu(Preheat1); break; @@ -1912,7 +1928,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 2 case TEMP_PREHEAT2: if (draw) - Draw_Menu_Item(row, ICON_Step, PREHEAT_2_LABEL, nullptr, true); + Draw_Menu_Item(row, ICON_Step, F(PREHEAT_2_LABEL), nullptr, true); else Draw_Menu(Preheat2); break; @@ -1920,7 +1936,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 3 case TEMP_PREHEAT3: if (draw) - Draw_Menu_Item(row, ICON_Step, PREHEAT_3_LABEL, nullptr, true); + Draw_Menu_Item(row, ICON_Step, F(PREHEAT_3_LABEL), nullptr, true); else Draw_Menu(Preheat3); break; @@ -1928,7 +1944,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 4 case TEMP_PREHEAT4: if (draw) - Draw_Menu_Item(row, ICON_Step, PREHEAT_4_LABEL, nullptr, true); + Draw_Menu_Item(row, ICON_Step, F(PREHEAT_4_LABEL), nullptr, true); else Draw_Menu(Preheat4); break; @@ -1936,7 +1952,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 5 case TEMP_PREHEAT5: if (draw) - Draw_Menu_Item(row, ICON_Step, PREHEAT_5_LABEL, nullptr, true); + Draw_Menu_Item(row, ICON_Step, F(PREHEAT_5_LABEL), nullptr, true); else Draw_Menu(Preheat5); break; @@ -1958,14 +1974,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PID_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(TempMenu, TEMP_PID); break; #if HAS_HOTEND case PID_HOTEND: if (draw) - Draw_Menu_Item(row, ICON_HotendTemp, "Hotend", nullptr, true); + Draw_Menu_Item(row, ICON_HotendTemp, F("Hotend"), nullptr, true); else Draw_Menu(HotendPID); break; @@ -1973,14 +1989,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HEATED_BED case PID_BED: if (draw) - Draw_Menu_Item(row, ICON_BedTemp, "Bed", nullptr, true); + Draw_Menu_Item(row, ICON_BedTemp, F("Bed"), nullptr, true); else Draw_Menu(BedPID); break; #endif case PID_CYCLES: if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, "Cycles"); + Draw_Menu_Item(row, ICON_FanSpeed, F("Cycles")); Draw_Float(PID_cycles, row, false, 1); } else @@ -2006,13 +2022,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case HOTENDPID_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(PID, PID_HOTEND); break; case HOTENDPID_TUNE: if (draw) - Draw_Menu_Item(row, ICON_HotendTemp, "Autotune"); + Draw_Menu_Item(row, ICON_HotendTemp, F("Autotune")); else { Popup_Handler(PIDWait); sprintf_P(cmd, PSTR("M303 E0 C%i S%i U1"), PID_cycles, PID_e_temp); @@ -2023,7 +2039,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case HOTENDPID_TEMP: if (draw) { - Draw_Menu_Item(row, ICON_Temperature, "Temperature"); + Draw_Menu_Item(row, ICON_Temperature, F("Temperature")); Draw_Float(PID_e_temp, row, false, 1); } else @@ -2031,7 +2047,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case HOTENDPID_KP: if (draw) { - Draw_Menu_Item(row, ICON_Version, "Kp Value"); + Draw_Menu_Item(row, ICON_Version, F("Kp Value")); Draw_Float(thermalManager.temp_hotend[0].pid.Kp, row, false, 100); } else @@ -2039,7 +2055,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case HOTENDPID_KI: if (draw) { - Draw_Menu_Item(row, ICON_Version, "Ki Value"); + Draw_Menu_Item(row, ICON_Version, F("Ki Value")); Draw_Float(unscalePID_i(thermalManager.temp_hotend[0].pid.Ki), row, false, 100); } else @@ -2047,7 +2063,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case HOTENDPID_KD: if (draw) { - Draw_Menu_Item(row, ICON_Version, "Kd Value"); + Draw_Menu_Item(row, ICON_Version, F("Kd Value")); Draw_Float(unscalePID_d(thermalManager.temp_hotend[0].pid.Kd), row, false, 100); } else @@ -2073,13 +2089,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case BEDPID_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(PID, PID_BED); break; case BEDPID_TUNE: if (draw) - Draw_Menu_Item(row, ICON_HotendTemp, "Autotune"); + Draw_Menu_Item(row, ICON_HotendTemp, F("Autotune")); else { Popup_Handler(PIDWait); sprintf_P(cmd, PSTR("M303 E-1 C%i S%i U1"), PID_cycles, PID_bed_temp); @@ -2090,7 +2106,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case BEDPID_TEMP: if (draw) { - Draw_Menu_Item(row, ICON_Temperature, "Temperature"); + Draw_Menu_Item(row, ICON_Temperature, F("Temperature")); Draw_Float(PID_bed_temp, row, false, 1); } else @@ -2098,7 +2114,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case BEDPID_KP: if (draw) { - Draw_Menu_Item(row, ICON_Version, "Kp Value"); + Draw_Menu_Item(row, ICON_Version, F("Kp Value")); Draw_Float(thermalManager.temp_bed.pid.Kp, row, false, 100); } else { @@ -2107,7 +2123,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case BEDPID_KI: if (draw) { - Draw_Menu_Item(row, ICON_Version, "Ki Value"); + Draw_Menu_Item(row, ICON_Version, F("Ki Value")); Draw_Float(unscalePID_i(thermalManager.temp_bed.pid.Ki), row, false, 100); } else @@ -2115,7 +2131,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case BEDPID_KD: if (draw) { - Draw_Menu_Item(row, ICON_Version, "Kd Value"); + Draw_Menu_Item(row, ICON_Version, F("Kd Value")); Draw_Float(unscalePID_d(thermalManager.temp_bed.pid.Kd), row, false, 100); } else @@ -2137,14 +2153,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PREHEAT1_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(TempMenu, TEMP_PREHEAT1); break; #if HAS_HOTEND case PREHEAT1_HOTEND: if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, "Hotend"); + Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); Draw_Float(ui.material_preset[0].hotend_temp, row, false, 1); } else @@ -2154,7 +2170,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HEATED_BED case PREHEAT1_BED: if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, "Bed"); + Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); Draw_Float(ui.material_preset[0].bed_temp, row, false, 1); } else @@ -2164,7 +2180,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_FAN case PREHEAT1_FAN: if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, "Fan"); + Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); Draw_Float(ui.material_preset[0].fan_speed, row, false, 1); } else @@ -2187,14 +2203,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PREHEAT2_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(TempMenu, TEMP_PREHEAT2); break; #if HAS_HOTEND case PREHEAT2_HOTEND: if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, "Hotend"); + Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); Draw_Float(ui.material_preset[1].hotend_temp, row, false, 1); } else @@ -2204,7 +2220,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HEATED_BED case PREHEAT2_BED: if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, "Bed"); + Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); Draw_Float(ui.material_preset[1].bed_temp, row, false, 1); } else @@ -2214,7 +2230,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_FAN case PREHEAT2_FAN: if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, "Fan"); + Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); Draw_Float(ui.material_preset[1].fan_speed, row, false, 1); } else @@ -2237,14 +2253,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PREHEAT3_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(TempMenu, TEMP_PREHEAT3); break; #if HAS_HOTEND case PREHEAT3_HOTEND: if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, "Hotend"); + Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); Draw_Float(ui.material_preset[2].hotend_temp, row, false, 1); } else @@ -2254,7 +2270,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HEATED_BED case PREHEAT3_BED: if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, "Bed"); + Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); Draw_Float(ui.material_preset[2].bed_temp, row, false, 1); } else @@ -2264,7 +2280,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_FAN case PREHEAT3_FAN: if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, "Fan"); + Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); Draw_Float(ui.material_preset[2].fan_speed, row, false, 1); } else @@ -2287,14 +2303,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PREHEAT4_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(TempMenu, TEMP_PREHEAT4); break; #if HAS_HOTEND case PREHEAT4_HOTEND: if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, "Hotend"); + Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); Draw_Float(ui.material_preset[3].hotend_temp, row, false, 1); } else @@ -2304,7 +2320,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HEATED_BED case PREHEAT4_BED: if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, "Bed"); + Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); Draw_Float(ui.material_preset[3].bed_temp, row, false, 1); } else @@ -2314,7 +2330,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_FAN case PREHEAT4_FAN: if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, "Fan"); + Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); Draw_Float(ui.material_preset[3].fan_speed, row, false, 1); } else @@ -2337,14 +2353,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PREHEAT5_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(TempMenu, TEMP_PREHEAT5); break; #if HAS_HOTEND case PREHEAT5_HOTEND: if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, "Hotend"); + Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); Draw_Float(ui.material_preset[4].hotend_temp, row, false, 1); } else @@ -2354,7 +2370,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HEATED_BED case PREHEAT5_BED: if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, "Bed"); + Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); Draw_Float(ui.material_preset[4].bed_temp, row, false, 1); } else @@ -2364,7 +2380,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_FAN case PREHEAT5_FAN: if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, "Fan"); + Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); Draw_Float(ui.material_preset[4].fan_speed, row, false, 1); } else @@ -2389,46 +2405,46 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case MOTION_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Control, CONTROL_MOTION); break; case MOTION_HOMEOFFSETS: if (draw) - Draw_Menu_Item(row, ICON_SetHome, "Home Offsets", nullptr, true); + Draw_Menu_Item(row, ICON_SetHome, F("Home Offsets"), nullptr, true); else Draw_Menu(HomeOffsets); break; case MOTION_SPEED: if (draw) - Draw_Menu_Item(row, ICON_MaxSpeed, "Max Speed", nullptr, true); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Max Speed"), nullptr, true); else Draw_Menu(MaxSpeed); break; case MOTION_ACCEL: if (draw) - Draw_Menu_Item(row, ICON_MaxAccelerated, "Max Acceleration", nullptr, true); + Draw_Menu_Item(row, ICON_MaxAccelerated, F("Max Acceleration"), nullptr, true); else Draw_Menu(MaxAcceleration); break; #if HAS_CLASSIC_JERK case MOTION_JERK: if (draw) - Draw_Menu_Item(row, ICON_MaxJerk, "Max Jerk", nullptr, true); + Draw_Menu_Item(row, ICON_MaxJerk, F("Max Jerk"), nullptr, true); else Draw_Menu(MaxJerk); break; #endif case MOTION_STEPS: if (draw) - Draw_Menu_Item(row, ICON_Step, "Steps/mm", nullptr, true); + Draw_Menu_Item(row, ICON_Step, F("Steps/mm"), nullptr, true); else Draw_Menu(Steps); break; #if HAS_HOTEND case MOTION_FLOW: if (draw) { - Draw_Menu_Item(row, ICON_Speed, "Flow Rate"); + Draw_Menu_Item(row, ICON_Speed, F("Flow Rate")); Draw_Float(planner.flow_percentage[0], row, false, 1); } else @@ -2448,13 +2464,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case HOMEOFFSETS_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Motion, MOTION_HOMEOFFSETS); break; case HOMEOFFSETS_XOFFSET: if (draw) { - Draw_Menu_Item(row, ICON_StepX, "X Offset"); + Draw_Menu_Item(row, ICON_StepX, F("X Offset")); Draw_Float(home_offset.x, row, false, 100); } else @@ -2462,7 +2478,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case HOMEOFFSETS_YOFFSET: if (draw) { - Draw_Menu_Item(row, ICON_StepY, "Y Offset"); + Draw_Menu_Item(row, ICON_StepY, F("Y Offset")); Draw_Float(home_offset.y, row, false, 100); } else @@ -2482,13 +2498,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case SPEED_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Motion, MOTION_SPEED); break; case SPEED_X: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeedX, "X Axis"); + Draw_Menu_Item(row, ICON_MaxSpeedX, F("X Axis")); Draw_Float(planner.settings.max_feedrate_mm_s[X_AXIS], row, false, 1); } else @@ -2498,7 +2514,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_Y_AXIS case SPEED_Y: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeedY, "Y Axis"); + Draw_Menu_Item(row, ICON_MaxSpeedY, F("Y Axis")); Draw_Float(planner.settings.max_feedrate_mm_s[Y_AXIS], row, false, 1); } else @@ -2509,7 +2525,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_Z_AXIS case SPEED_Z: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeedZ, "Z Axis"); + Draw_Menu_Item(row, ICON_MaxSpeedZ, F("Z Axis")); Draw_Float(planner.settings.max_feedrate_mm_s[Z_AXIS], row, false, 1); } else @@ -2520,7 +2536,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HOTEND case SPEED_E: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeedE, "Extruder"); + Draw_Menu_Item(row, ICON_MaxSpeedE, F("Extruder")); Draw_Float(planner.settings.max_feedrate_mm_s[E_AXIS], row, false, 1); } else @@ -2542,13 +2558,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case ACCEL_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Motion, MOTION_ACCEL); break; case ACCEL_X: if (draw) { - Draw_Menu_Item(row, ICON_MaxAccX, "X Axis"); + Draw_Menu_Item(row, ICON_MaxAccX, F("X Axis")); Draw_Float(planner.settings.max_acceleration_mm_per_s2[X_AXIS], row, false, 1); } else @@ -2556,7 +2572,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case ACCEL_Y: if (draw) { - Draw_Menu_Item(row, ICON_MaxAccY, "Y Axis"); + Draw_Menu_Item(row, ICON_MaxAccY, F("Y Axis")); Draw_Float(planner.settings.max_acceleration_mm_per_s2[Y_AXIS], row, false, 1); } else @@ -2564,7 +2580,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case ACCEL_Z: if (draw) { - Draw_Menu_Item(row, ICON_MaxAccZ, "Z Axis"); + Draw_Menu_Item(row, ICON_MaxAccZ, F("Z Axis")); Draw_Float(planner.settings.max_acceleration_mm_per_s2[Z_AXIS], row, false, 1); } else @@ -2573,7 +2589,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HOTEND case ACCEL_E: if (draw) { - Draw_Menu_Item(row, ICON_MaxAccE, "Extruder"); + Draw_Menu_Item(row, ICON_MaxAccE, F("Extruder")); Draw_Float(planner.settings.max_acceleration_mm_per_s2[E_AXIS], row, false, 1); } else @@ -2595,13 +2611,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case JERK_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Motion, MOTION_JERK); break; case JERK_X: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeedJerkX, "X Axis"); + Draw_Menu_Item(row, ICON_MaxSpeedJerkX, F("X Axis")); Draw_Float(planner.max_jerk[X_AXIS], row, false, 10); } else @@ -2609,7 +2625,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case JERK_Y: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeedJerkY, "Y Axis"); + Draw_Menu_Item(row, ICON_MaxSpeedJerkY, F("Y Axis")); Draw_Float(planner.max_jerk[Y_AXIS], row, false, 10); } else @@ -2617,7 +2633,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case JERK_Z: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeedJerkZ, "Z Axis"); + Draw_Menu_Item(row, ICON_MaxSpeedJerkZ, F("Z Axis")); Draw_Float(planner.max_jerk[Z_AXIS], row, false, 10); } else @@ -2626,7 +2642,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HOTEND case JERK_E: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeedJerkE, "Extruder"); + Draw_Menu_Item(row, ICON_MaxSpeedJerkE, F("Extruder")); Draw_Float(planner.max_jerk[E_AXIS], row, false, 10); } else @@ -2648,13 +2664,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case STEPS_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Motion, MOTION_STEPS); break; case STEPS_X: if (draw) { - Draw_Menu_Item(row, ICON_StepX, "X Axis"); + Draw_Menu_Item(row, ICON_StepX, F("X Axis")); Draw_Float(planner.settings.axis_steps_per_mm[X_AXIS], row, false, 10); } else @@ -2662,7 +2678,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case STEPS_Y: if (draw) { - Draw_Menu_Item(row, ICON_StepY, "Y Axis"); + Draw_Menu_Item(row, ICON_StepY, F("Y Axis")); Draw_Float(planner.settings.axis_steps_per_mm[Y_AXIS], row, false, 10); } else @@ -2670,7 +2686,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case STEPS_Z: if (draw) { - Draw_Menu_Item(row, ICON_StepZ, "Z Axis"); + Draw_Menu_Item(row, ICON_StepZ, F("Z Axis")); Draw_Float(planner.settings.axis_steps_per_mm[Z_AXIS], row, false, 10); } else @@ -2679,7 +2695,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HOTEND case STEPS_E: if (draw) { - Draw_Menu_Item(row, ICON_StepE, "Extruder"); + Draw_Menu_Item(row, ICON_StepE, F("Extruder")); Draw_Float(planner.settings.axis_steps_per_mm[E_AXIS], row, false, 10); } else @@ -2701,19 +2717,19 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case VISUAL_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Control, CONTROL_VISUAL); break; case VISUAL_BACKLIGHT: if (draw) - Draw_Menu_Item(row, ICON_Brightness, "Display Off"); + Draw_Menu_Item(row, ICON_Brightness, F("Display Off")); else ui.set_brightness(0); break; case VISUAL_BRIGHTNESS: if (draw) { - Draw_Menu_Item(row, ICON_Brightness, "LCD Brightness"); + Draw_Menu_Item(row, ICON_Brightness, F("LCD Brightness")); Draw_Float(ui.brightness, row, false, 1); } else @@ -2721,7 +2737,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case VISUAL_TIME_FORMAT: if (draw) { - Draw_Menu_Item(row, ICON_PrintTime, "Progress as __h__m"); + Draw_Menu_Item(row, ICON_PrintTime, F("Progress as __h__m")); Draw_Checkbox(row, eeprom_settings.time_format_textual); } else { @@ -2731,7 +2747,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case VISUAL_COLOR_THEMES: if (draw) - Draw_Menu_Item(row, ICON_MaxSpeed, "UI Color Settings", nullptr, true); + Draw_Menu_Item(row, ICON_MaxSpeed, F("UI Color Settings"), nullptr, true); else Draw_Menu(ColorSettings); break; @@ -2757,13 +2773,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case COLORSETTINGS_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Visual, VISUAL_COLOR_THEMES); break; case COLORSETTINGS_CURSOR: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Cursor"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Cursor")); Draw_Option(eeprom_settings.cursor_color, color_names, row, false, true); } else @@ -2771,7 +2787,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_SPLIT_LINE: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Menu Split Line"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Menu Split Line")); Draw_Option(eeprom_settings.menu_split_line, color_names, row, false, true); } else @@ -2779,7 +2795,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_MENU_TOP_TXT: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Menu Header Text"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Menu Header Text")); Draw_Option(eeprom_settings.menu_top_txt, color_names, row, false, true); } else @@ -2787,7 +2803,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_MENU_TOP_BG: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Menu Header Bg"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Menu Header Bg")); Draw_Option(eeprom_settings.menu_top_bg, color_names, row, false, true); } else @@ -2795,7 +2811,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_HIGHLIGHT_BORDER: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Highlight Box"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Highlight Box")); Draw_Option(eeprom_settings.highlight_box, color_names, row, false, true); } else @@ -2803,7 +2819,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_PROGRESS_PERCENT: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Progress Percent"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Progress Percent")); Draw_Option(eeprom_settings.progress_percent, color_names, row, false, true); } else @@ -2811,7 +2827,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_PROGRESS_TIME: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Progress Time"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Progress Time")); Draw_Option(eeprom_settings.progress_time, color_names, row, false, true); } else @@ -2819,7 +2835,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_PROGRESS_STATUS_BAR: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Status Bar Text"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Status Bar Text")); Draw_Option(eeprom_settings.status_bar_text, color_names, row, false, true); } else @@ -2827,7 +2843,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_PROGRESS_STATUS_AREA: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Status Area Text"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Status Area Text")); Draw_Option(eeprom_settings.status_area_text, color_names, row, false, true); } else @@ -2835,7 +2851,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_PROGRESS_COORDINATES: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Coordinates Text"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Coordinates Text")); Draw_Option(eeprom_settings.coordinates_text, color_names, row, false, true); } else @@ -2843,7 +2859,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case COLORSETTINGS_PROGRESS_COORDINATES_LINE: if (draw) { - Draw_Menu_Item(row, ICON_MaxSpeed, "Coordinates Line"); + Draw_Menu_Item(row, ICON_MaxSpeed, F("Coordinates Line")); Draw_Option(eeprom_settings.coordinates_split_line, color_names, row, false, true); } else @@ -2870,7 +2886,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case ADVANCED_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Control, CONTROL_ADVANCED); break; @@ -2878,7 +2894,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(SOUND_MENU_ITEM) case ADVANCED_BEEPER: if (draw) { - Draw_Menu_Item(row, ICON_Version, "LCD Beeper"); + Draw_Menu_Item(row, ICON_Version, F("LCD Beeper")); Draw_Checkbox(row, ui.buzzer_enabled); } else { @@ -2891,7 +2907,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_BED_PROBE case ADVANCED_PROBE: if (draw) - Draw_Menu_Item(row, ICON_StepX, "Probe", nullptr, true); + Draw_Menu_Item(row, ICON_StepX, F("Probe"), nullptr, true); else Draw_Menu(ProbeMenu); break; @@ -2899,7 +2915,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case ADVANCED_CORNER: if (draw) { - Draw_Menu_Item(row, ICON_MaxAccelerated, "Bed Screw Inset"); + Draw_Menu_Item(row, ICON_MaxAccelerated, F("Bed Screw Inset")); Draw_Float(corner_pos, row, false, 10); } else @@ -2909,7 +2925,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(LIN_ADVANCE) case ADVANCED_LA: if (draw) { - Draw_Menu_Item(row, ICON_MaxAccelerated, "Lin Advance Kp"); + Draw_Menu_Item(row, ICON_MaxAccelerated, F("Lin Advance Kp")); Draw_Float(planner.extruder_advance_K[0], row, false, 100); } else @@ -2920,7 +2936,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(ADVANCED_PAUSE_FEATURE) case ADVANCED_LOAD: if (draw) { - Draw_Menu_Item(row, ICON_WriteEEPROM, "Load Length"); + Draw_Menu_Item(row, ICON_WriteEEPROM, F("Load Length")); Draw_Float(fc_settings[0].load_length, row, false, 1); } else @@ -2928,7 +2944,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case ADVANCED_UNLOAD: if (draw) { - Draw_Menu_Item(row, ICON_ReadEEPROM, "Unload Length"); + Draw_Menu_Item(row, ICON_ReadEEPROM, F("Unload Length")); Draw_Float(fc_settings[0].unload_length, row, false, 1); } else @@ -2939,7 +2955,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(PREVENT_COLD_EXTRUSION) case ADVANCED_COLD_EXTRUDE: if (draw) { - Draw_Menu_Item(row, ICON_Cool, "Min Extrusion T"); + Draw_Menu_Item(row, ICON_Cool, F("Min Extrusion T")); Draw_Float(thermalManager.extrude_min_temp, row, false, 1); } else { @@ -2952,7 +2968,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(FILAMENT_RUNOUT_SENSOR) case ADVANCED_FILSENSORENABLED: if (draw) { - Draw_Menu_Item(row, ICON_Extruder, "Filament Sensor"); + Draw_Menu_Item(row, ICON_Extruder, F("Filament Sensor")); Draw_Checkbox(row, runout.enabled); } else { @@ -2964,7 +2980,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE) case ADVANCED_FILSENSORDISTANCE: if (draw) { - Draw_Menu_Item(row, ICON_MaxAccE, "Runout Distance"); + Draw_Menu_Item(row, ICON_MaxAccE, F("Runout Distance")); Draw_Float(runout.runout_distance(), row, false, 10); } else @@ -2976,7 +2992,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(POWER_LOSS_RECOVERY) case ADVANCED_POWER_LOSS: if (draw) { - Draw_Menu_Item(row, ICON_Motion, "Power-loss recovery"); + Draw_Menu_Item(row, ICON_Motion, F("Power-loss recovery")); Draw_Checkbox(row, recovery.enabled); } else { @@ -3003,14 +3019,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PROBE_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Advanced, ADVANCED_PROBE); break; case PROBE_XOFFSET: if (draw) { - Draw_Menu_Item(row, ICON_StepX, "Probe X Offset"); + Draw_Menu_Item(row, ICON_StepX, F("Probe X Offset")); Draw_Float(probe.offset.x, row, false, 10); } else @@ -3018,7 +3034,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case PROBE_YOFFSET: if (draw) { - Draw_Menu_Item(row, ICON_StepY, "Probe Y Offset"); + Draw_Menu_Item(row, ICON_StepY, F("Probe Y Offset")); Draw_Float(probe.offset.y, row, false, 10); } else @@ -3026,7 +3042,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case PROBE_TEST: if (draw) - Draw_Menu_Item(row, ICON_StepY, "M48 Probe Test"); + Draw_Menu_Item(row, ICON_StepY, F("M48 Probe Test")); else { sprintf_P(cmd, PSTR("G28O\nM48 X%s Y%s P%i"), dtostrf((X_BED_SIZE + X_MIN_POS) / 2.0f, 1, 3, str_1), dtostrf((Y_BED_SIZE + Y_MIN_POS) / 2.0f, 1, 3, str_2), testcount); gcode.process_subcommands_now_P(cmd); @@ -3034,7 +3050,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case PROBE_TEST_COUNT: if (draw) { - Draw_Menu_Item(row, ICON_StepY, "Probe Test Count"); + Draw_Menu_Item(row, ICON_StepY, F("Probe Test Count")); Draw_Float(testcount, row, false, 1); } else @@ -3058,7 +3074,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case INFO_BACK: if (draw) { - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); #if ENABLED(PRINTCOUNTER) char row1[50], row2[50], buf[32]; @@ -3075,9 +3091,9 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Draw_Menu_Item(INFO_PRINTTIME, ICON_PrintTime, row1, row2, false, true); #endif - Draw_Menu_Item(INFO_SIZE, ICON_PrintSize, MACHINE_SIZE, nullptr, false, true); - Draw_Menu_Item(INFO_VERSION, ICON_Version, SHORT_BUILD_VERSION, nullptr, false, true); - Draw_Menu_Item(INFO_CONTACT, ICON_Contact, CORP_WEBSITE, nullptr, false, true); + Draw_Menu_Item(INFO_SIZE, ICON_PrintSize, F(MACHINE_SIZE), nullptr, false, true); + Draw_Menu_Item(INFO_VERSION, ICON_Version, F(SHORT_BUILD_VERSION), nullptr, false, true); + Draw_Menu_Item(INFO_CONTACT, ICON_Contact, F(CORP_WEBSITE), nullptr, false, true); } else { if (menu == Info) @@ -3107,13 +3123,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case LEVELING_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Main_Menu(3); break; case LEVELING_ACTIVE: if (draw) { - Draw_Menu_Item(row, ICON_StockConfiguration, "Leveling Active"); + Draw_Menu_Item(row, ICON_StockConfiguration, F("Leveling Active")); Draw_Checkbox(row, planner.leveling_active); } else { @@ -3132,7 +3148,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if BOTH(HAS_BED_PROBE, AUTO_BED_LEVELING_UBL) case LEVELING_GET_TILT: if (draw) - Draw_Menu_Item(row, ICON_Tilt, "Autotilt Current Mesh"); + Draw_Menu_Item(row, ICON_Tilt, F("Autotilt Current Mesh")); else { if (ubl.storage_slot < 0) { Popup_Handler(MeshSlot); @@ -3153,7 +3169,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #endif case LEVELING_GET_MESH: if (draw) - Draw_Menu_Item(row, ICON_Mesh, "Create New Mesh"); + Draw_Menu_Item(row, ICON_Mesh, F("Create New Mesh")); else { Popup_Handler(Home); gcode.home_all_axes(true); @@ -3205,7 +3221,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_MANUAL: if (draw) - Draw_Menu_Item(row, ICON_Mesh, "Manual Tuning", nullptr, true); + Draw_Menu_Item(row, ICON_Mesh, F("Manual Tuning"), nullptr, true); else { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) if (!leveling_is_valid()) { @@ -3259,14 +3275,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_SETTINGS: if (draw) - Draw_Menu_Item(row, ICON_Step, "Leveling Settings", nullptr, true); + Draw_Menu_Item(row, ICON_Step, F("Leveling Settings"), nullptr, true); else Draw_Menu(LevelSettings); break; #if ENABLED(AUTO_BED_LEVELING_UBL) case LEVELING_SLOT: if (draw) { - Draw_Menu_Item(row, ICON_PrintSize, "Mesh Slot"); + Draw_Menu_Item(row, ICON_PrintSize, F("Mesh Slot")); Draw_Float(ubl.storage_slot, row, false, 1); } else @@ -3274,7 +3290,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_LOAD: if (draw) - Draw_Menu_Item(row, ICON_ReadEEPROM, "Load Mesh"); + Draw_Menu_Item(row, ICON_ReadEEPROM, F("Load Mesh")); else { if (ubl.storage_slot < 0) { Popup_Handler(MeshSlot); @@ -3287,7 +3303,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_SAVE: if (draw) - Draw_Menu_Item(row, ICON_WriteEEPROM, "Save Mesh"); + Draw_Menu_Item(row, ICON_WriteEEPROM, F("Save Mesh")); else { if (ubl.storage_slot < 0) { Popup_Handler(MeshSlot); @@ -3313,7 +3329,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case LEVELING_VIEW_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Leveling, LEVELING_VIEW); break; @@ -3325,7 +3341,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_VIEW_TEXT: if (draw) { - Draw_Menu_Item(row, ICON_Contact, "Viewer Show Values"); + Draw_Menu_Item(row, ICON_Contact, F("Viewer Show Values")); Draw_Checkbox(row, mesh_conf.viewer_print_value); } else { @@ -3335,7 +3351,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_VIEW_ASYMMETRIC: if (draw) { - Draw_Menu_Item(row, ICON_Axis, "Viewer Asymmetric"); + Draw_Menu_Item(row, ICON_Axis, F("Viewer Asymmetric")); Draw_Checkbox(row, mesh_conf.viewer_asymmetric_range); } else { @@ -3359,13 +3375,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case LEVELING_SETTINGS_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Menu(Leveling, LEVELING_SETTINGS); break; case LEVELING_SETTINGS_FADE: if (draw) { - Draw_Menu_Item(row, ICON_Fade, "Fade Mesh within"); + Draw_Menu_Item(row, ICON_Fade, F("Fade Mesh within")); Draw_Float(planner.z_fade_height, row, false, 1); } else { @@ -3378,7 +3394,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(AUTO_BED_LEVELING_UBL) case LEVELING_SETTINGS_TILT: if (draw) { - Draw_Menu_Item(row, ICON_Tilt, "Tilting Grid Size"); + Draw_Menu_Item(row, ICON_Tilt, F("Tilting Grid Size")); Draw_Float(mesh_conf.tilt_grid, row, false, 1); } else @@ -3386,7 +3402,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_SETTINGS_PLANE: if (draw) - Draw_Menu_Item(row, ICON_ResumeEEPROM, "Convert Mesh to Plane"); + Draw_Menu_Item(row, ICON_ResumeEEPROM, F("Convert Mesh to Plane")); else { if (mesh_conf.create_plane_from_mesh()) break; gcode.process_subcommands_now_P(PSTR("M420 S1")); @@ -3396,13 +3412,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_SETTINGS_ZERO: if (draw) - Draw_Menu_Item(row, ICON_Mesh, "Zero Current Mesh"); + Draw_Menu_Item(row, ICON_Mesh, F("Zero Current Mesh")); else ZERO(Z_VALUES_ARR); break; case LEVELING_SETTINGS_UNDEF: if (draw) - Draw_Menu_Item(row, ICON_Mesh, "Clear Current Mesh"); + Draw_Menu_Item(row, ICON_Mesh, F("Clear Current Mesh")); else ubl.invalidate(); break; @@ -3416,7 +3432,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ if (item == MESHVIEW_BACK) { if (draw) { - Draw_Menu_Item(0, ICON_Back, "Back"); + Draw_Menu_Item(0, ICON_Back, F("Back")); mesh_conf.Draw_Bed_Mesh(); mesh_conf.Set_Mesh_Viewer_Status(); } @@ -3443,7 +3459,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case LEVELING_M_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else { set_bed_leveling_enabled(level_state); TERN_(AUTO_BED_LEVELING_BILINEAR, refresh_bed_level()); @@ -3452,7 +3468,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_M_X: if (draw) { - Draw_Menu_Item(row, ICON_MoveX, "Mesh Point X"); + Draw_Menu_Item(row, ICON_MoveX, F("Mesh Point X")); Draw_Float(mesh_conf.mesh_x, row, 0, 1); } else @@ -3460,7 +3476,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_M_Y: if (draw) { - Draw_Menu_Item(row, ICON_MoveY, "Mesh Point Y"); + Draw_Menu_Item(row, ICON_MoveY, F("Mesh Point Y")); Draw_Float(mesh_conf.mesh_y, row, 0, 1); } else @@ -3468,7 +3484,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_M_NEXT: if (draw) - Draw_Menu_Item(row, ICON_More, "Next Point"); + Draw_Menu_Item(row, ICON_More, F("Next Point")); else { if (mesh_conf.mesh_x != (GRID_MAX_POINTS_X - 1) || mesh_conf.mesh_y != (GRID_MAX_POINTS_Y - 1)) { if ((mesh_conf.mesh_x == (GRID_MAX_POINTS_X - 1) && mesh_conf.mesh_y % 2 == 0) || (mesh_conf.mesh_x == 0 && mesh_conf.mesh_y % 2 == 1)) @@ -3483,7 +3499,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_M_OFFSET: if (draw) { - Draw_Menu_Item(row, ICON_SetZOffset, "Point Z Offset"); + Draw_Menu_Item(row, ICON_SetZOffset, F("Point Z Offset")); Draw_Float(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], row, false, 100); } else { @@ -3494,7 +3510,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_M_UP: if (draw) - Draw_Menu_Item(row, ICON_Axis, "Microstep Up"); + Draw_Menu_Item(row, ICON_Axis, F("Microstep Up")); else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; gcode.process_subcommands_now_P(PSTR("M290 Z0.01")); @@ -3506,7 +3522,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_M_DOWN: if (draw) - Draw_Menu_Item(row, ICON_AxisD, "Microstep Down"); + Draw_Menu_Item(row, ICON_AxisD, F("Microstep Down")); else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; gcode.process_subcommands_now_P(PSTR("M290 Z-0.01")); @@ -3518,7 +3534,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_M_GOTO_VALUE: if (draw) { - Draw_Menu_Item(row, ICON_StockConfiguration, "Go to Mesh Z Value"); + Draw_Menu_Item(row, ICON_StockConfiguration, F("Go to Mesh Z Value")); Draw_Checkbox(row, mesh_conf.goto_mesh_value); } else { @@ -3531,7 +3547,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(AUTO_BED_LEVELING_UBL) case LEVELING_M_UNDEF: if (draw) - Draw_Menu_Item(row, ICON_ResumeEEPROM, "Clear Point Value"); + Draw_Menu_Item(row, ICON_ResumeEEPROM, F("Clear Point Value")); else { mesh_conf.manual_value_update(true); Redraw_Menu(false); @@ -3556,7 +3572,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case UBL_M_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else { set_bed_leveling_enabled(level_state); Draw_Menu(Leveling, LEVELING_GET_MESH); @@ -3565,9 +3581,9 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case UBL_M_NEXT: if (draw) { if (mesh_conf.mesh_x != (GRID_MAX_POINTS_X - 1) || mesh_conf.mesh_y != (GRID_MAX_POINTS_Y - 1)) - Draw_Menu_Item(row, ICON_More, "Next Point"); + Draw_Menu_Item(row, ICON_More, F("Next Point")); else - Draw_Menu_Item(row, ICON_More, "Save Mesh"); + Draw_Menu_Item(row, ICON_More, F("Save Mesh")); } else { if (mesh_conf.mesh_x != (GRID_MAX_POINTS_X - 1) || mesh_conf.mesh_y != (GRID_MAX_POINTS_Y - 1)) { @@ -3589,7 +3605,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case UBL_M_PREV: if (draw) - Draw_Menu_Item(row, ICON_More, "Previous Point"); + Draw_Menu_Item(row, ICON_More, F("Previous Point")); else { if (mesh_conf.mesh_x != 0 || mesh_conf.mesh_y != 0) { if ((mesh_conf.mesh_x == (GRID_MAX_POINTS_X - 1) && mesh_conf.mesh_y % 2 == 1) || (mesh_conf.mesh_x == 0 && mesh_conf.mesh_y % 2 == 0)) @@ -3604,7 +3620,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case UBL_M_OFFSET: if (draw) { - Draw_Menu_Item(row, ICON_SetZOffset, "Point Z Offset"); + Draw_Menu_Item(row, ICON_SetZOffset, F("Point Z Offset")); Draw_Float(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], row, false, 100); } else { @@ -3615,7 +3631,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case UBL_M_UP: if (draw) - Draw_Menu_Item(row, ICON_Axis, "Microstep Up"); + Draw_Menu_Item(row, ICON_Axis, F("Microstep Up")); else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; gcode.process_subcommands_now_P(PSTR("M290 Z0.01")); @@ -3627,7 +3643,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case UBL_M_DOWN: if (draw) - Draw_Menu_Item(row, ICON_Axis, "Microstep Down"); + Draw_Menu_Item(row, ICON_Axis, F("Microstep Down")); else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; gcode.process_subcommands_now_P(PSTR("M290 Z-0.01")); @@ -3655,7 +3671,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case MMESH_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Cancel"); + Draw_Menu_Item(row, ICON_Back, F("Cancel")); else { gcode.process_subcommands_now_P(PSTR("G29 A")); planner.synchronize(); @@ -3666,9 +3682,9 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case MMESH_NEXT: if (draw) { if (gridpoint < GRID_MAX_POINTS) - Draw_Menu_Item(row, ICON_More, "Next Point"); + Draw_Menu_Item(row, ICON_More, F("Next Point")); else - Draw_Menu_Item(row, ICON_More, "Save Mesh"); + Draw_Menu_Item(row, ICON_More, F("Save Mesh")); } else if (gridpoint < GRID_MAX_POINTS) { Popup_Handler(MoveWait); @@ -3686,7 +3702,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MMESH_OFFSET: if (draw) { - Draw_Menu_Item(row, ICON_SetZOffset, "Z Position"); + Draw_Menu_Item(row, ICON_SetZOffset, F("Z Position")); current_position.z = MANUAL_PROBE_START_Z; Draw_Float(current_position.z, row, false, 100); } @@ -3695,7 +3711,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MMESH_UP: if (draw) - Draw_Menu_Item(row, ICON_Axis, "Microstep Up"); + Draw_Menu_Item(row, ICON_Axis, F("Microstep Up")); else if (current_position.z < MAX_Z_OFFSET) { gcode.process_subcommands_now_P(PSTR("M290 Z0.01")); planner.synchronize(); @@ -3706,7 +3722,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case MMESH_DOWN: if (draw) - Draw_Menu_Item(row, ICON_AxisD, "Microstep Down"); + Draw_Menu_Item(row, ICON_AxisD, F("Microstep Down")); else if (current_position.z > MIN_Z_OFFSET) { gcode.process_subcommands_now_P(PSTR("M290 Z-0.01")); planner.synchronize(); @@ -3727,7 +3743,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ const float currval = Z_VALUES_ARR[mesh_x][mesh_y]; if (draw) { - Draw_Menu_Item(row, ICON_Zoffset, "Goto Mesh Value"); + Draw_Menu_Item(row, ICON_Zoffset, F("Goto Mesh Value")); Draw_Float(currval, row, false, 100); } else if (!isnan(currval)) { @@ -3762,13 +3778,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case TUNE_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Back"); + Draw_Menu_Item(row, ICON_Back, F("Back")); else Draw_Print_Screen(); break; case TUNE_SPEED: if (draw) { - Draw_Menu_Item(row, ICON_Speed, "Print Speed"); + Draw_Menu_Item(row, ICON_Speed, F("Print Speed")); Draw_Float(feedrate_percentage, row, false, 1); } else @@ -3778,7 +3794,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HOTEND case TUNE_FLOW: if (draw) { - Draw_Menu_Item(row, ICON_Speed, "Flow Rate"); + Draw_Menu_Item(row, ICON_Speed, F("Flow Rate")); Draw_Float(planner.flow_percentage[0], row, false, 1); } else @@ -3786,7 +3802,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case TUNE_HOTEND: if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, "Hotend"); + Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); Draw_Float(thermalManager.temp_hotend[0].target, row, false, 1); } else @@ -3797,7 +3813,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_HEATED_BED case TUNE_BED: if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, "Bed"); + Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); Draw_Float(thermalManager.temp_bed.target, row, false, 1); } else @@ -3808,7 +3824,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_FAN case TUNE_FAN: if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, "Fan"); + Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); Draw_Float(thermalManager.fan_speed[0], row, false, 1); } else @@ -3819,7 +3835,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_ZOFFSET_ITEM case TUNE_ZOFFSET: if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, "Z-Offset"); + Draw_Menu_Item(row, ICON_FanSpeed, F("Z-Offset")); Draw_Float(zoffsetvalue, row, false, 100); } else @@ -3827,7 +3843,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case TUNE_ZUP: if (draw) - Draw_Menu_Item(row, ICON_Axis, "Z-Offset Up"); + Draw_Menu_Item(row, ICON_Axis, F("Z-Offset Up")); else if (zoffsetvalue < MAX_Z_OFFSET) { gcode.process_subcommands_now_P(PSTR("M290 Z0.01")); zoffsetvalue += 0.01; @@ -3836,7 +3852,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case TUNE_ZDOWN: if (draw) - Draw_Menu_Item(row, ICON_AxisD, "Z-Offset Down"); + Draw_Menu_Item(row, ICON_AxisD, F("Z-Offset Down")); else if (zoffsetvalue > MIN_Z_OFFSET) { gcode.process_subcommands_now_P(PSTR("M290 Z-0.01")); zoffsetvalue -= 0.01; @@ -3848,7 +3864,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) case TUNE_CHANGEFIL: if (draw) - Draw_Menu_Item(row, ICON_ResumeEEPROM, "Change Filament"); + Draw_Menu_Item(row, ICON_ResumeEEPROM, F("Change Filament")); else Popup_Handler(ConfFilChange); break; @@ -3857,7 +3873,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(FILAMENT_RUNOUT_SENSOR) case TUNE_FILSENSORENABLED: if (draw) { - Draw_Menu_Item(row, ICON_Extruder, "Filament Sensor"); + Draw_Menu_Item(row, ICON_Extruder, F("Filament Sensor")); Draw_Checkbox(row, runout.enabled); } else { @@ -3869,13 +3885,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case TUNE_BACKLIGHT_OFF: if (draw) - Draw_Menu_Item(row, ICON_Brightness, "Display Off"); + Draw_Menu_Item(row, ICON_Brightness, F("Display Off")); else ui.set_brightness(0); break; case TUNE_BACKLIGHT: if (draw) { - Draw_Menu_Item(row, ICON_Brightness, "LCD Brightness"); + Draw_Menu_Item(row, ICON_Brightness, F("LCD Brightness")); Draw_Float(ui.brightness, row, false, 1); } else @@ -3899,7 +3915,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ switch (item) { case PREHEATHOTEND_BACK: if (draw) - Draw_Menu_Item(row, ICON_Back, "Cancel"); + Draw_Menu_Item(row, ICON_Back, F("Cancel")); else { thermalManager.setTargetHotend(0, 0); thermalManager.set_fan_speed(0, 0); @@ -3908,7 +3924,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case PREHEATHOTEND_CONTINUE: if (draw) - Draw_Menu_Item(row, ICON_SetEndTemp, "Continue"); + Draw_Menu_Item(row, ICON_SetEndTemp, F("Continue")); else { Popup_Handler(Heating); thermalManager.wait_for_hotend(0); @@ -3950,7 +3966,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 1 case PREHEATHOTEND_1: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_1_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL)); else { thermalManager.setTargetHotend(ui.material_preset[0].hotend_temp, 0); thermalManager.set_fan_speed(0, ui.material_preset[0].fan_speed); @@ -3960,7 +3976,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 2 case PREHEATHOTEND_2: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_2_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL)); else { thermalManager.setTargetHotend(ui.material_preset[1].hotend_temp, 0); thermalManager.set_fan_speed(0, ui.material_preset[1].fan_speed); @@ -3970,7 +3986,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 3 case PREHEATHOTEND_3: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_3_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL)); else { thermalManager.setTargetHotend(ui.material_preset[2].hotend_temp, 0); thermalManager.set_fan_speed(0, ui.material_preset[2].fan_speed); @@ -3980,7 +3996,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 4 case PREHEATHOTEND_4: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_4_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL)); else { thermalManager.setTargetHotend(ui.material_preset[3].hotend_temp, 0); thermalManager.set_fan_speed(0, ui.material_preset[3].fan_speed); @@ -3990,7 +4006,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if PREHEAT_COUNT >= 5 case PREHEATHOTEND_5: if (draw) - Draw_Menu_Item(row, ICON_Temperature, PREHEAT_5_LABEL); + Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL)); else { thermalManager.setTargetHotend(ui.material_preset[4].hotend_temp, 0); thermalManager.set_fan_speed(0, ui.material_preset[4].fan_speed); @@ -3999,7 +4015,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #endif case PREHEATHOTEND_CUSTOM: if (draw) { - Draw_Menu_Item(row, ICON_Temperature, "Custom"); + Draw_Menu_Item(row, ICON_Temperature, F("Custom")); Draw_Float(thermalManager.temp_hotend[0].target, row, false, 1); } else @@ -4010,81 +4026,81 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ } } -const char * CrealityDWINClass::Get_Menu_Title(uint8_t menu) { +FSTR_P CrealityDWINClass::Get_Menu_Title(uint8_t menu) { switch (menu) { - case MainMenu: return "Main Menu"; - case Prepare: return "Prepare"; - case HomeMenu: return "Homing Menu"; - case Move: return "Move"; - case ManualLevel: return "Manual Leveling"; + case MainMenu: return F("Main Menu"); + case Prepare: return F("Prepare"); + case HomeMenu: return F("Homing Menu"); + case Move: return F("Move"); + case ManualLevel: return F("Manual Leveling"); #if HAS_ZOFFSET_ITEM - case ZOffset: return "Z Offset"; + case ZOffset: return F("Z Offset"); #endif #if HAS_PREHEAT - case Preheat: return "Preheat"; + case Preheat: return F("Preheat"); #endif #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - case ChangeFilament: return "Change Filament"; + case ChangeFilament: return F("Change Filament"); #endif - case Control: return "Control"; - case TempMenu: return "Temperature"; + case Control: return F("Control"); + case TempMenu: return F("Temperature"); #if HAS_HOTEND || HAS_HEATED_BED - case PID: return "PID Menu"; + case PID: return F("PID Menu"); #endif #if HAS_HOTEND - case HotendPID: return "Hotend PID Settings"; + case HotendPID: return F("Hotend PID Settings"); #endif #if HAS_HEATED_BED - case BedPID: return "Bed PID Settings"; + case BedPID: return F("Bed PID Settings"); #endif #if PREHEAT_COUNT >= 1 - case Preheat1: return (PREHEAT_1_LABEL " Settings"); + case Preheat1: return F(PREHEAT_1_LABEL " Settings"); #endif #if PREHEAT_COUNT >= 2 - case Preheat2: return (PREHEAT_2_LABEL " Settings"); + case Preheat2: return F(PREHEAT_2_LABEL " Settings"); #endif #if PREHEAT_COUNT >= 3 - case Preheat3: return (PREHEAT_3_LABEL " Settings"); + case Preheat3: return F(PREHEAT_3_LABEL " Settings"); #endif #if PREHEAT_COUNT >= 4 - case Preheat4: return (PREHEAT_4_LABEL " Settings"); + case Preheat4: return F(PREHEAT_4_LABEL " Settings"); #endif #if PREHEAT_COUNT >= 5 - case Preheat5: return (PREHEAT_5_LABEL " Settings"); + case Preheat5: return F(PREHEAT_5_LABEL " Settings"); #endif - case Motion: return "Motion Settings"; - case HomeOffsets: return "Home Offsets"; - case MaxSpeed: return "Max Speed"; - case MaxAcceleration: return "Max Acceleration"; + case Motion: return F("Motion Settings"); + case HomeOffsets: return F("Home Offsets"); + case MaxSpeed: return F("Max Speed"); + case MaxAcceleration: return F("Max Acceleration"); #if HAS_CLASSIC_JERK - case MaxJerk: return "Max Jerk"; + case MaxJerk: return F("Max Jerk"); #endif - case Steps: return "Steps/mm"; - case Visual: return "Visual Settings"; - case Advanced: return "Advanced Settings"; + case Steps: return F("Steps/mm"); + case Visual: return F("Visual Settings"); + case Advanced: return F("Advanced Settings"); #if HAS_BED_PROBE - case ProbeMenu: return "Probe Menu"; + case ProbeMenu: return F("Probe Menu"); #endif - case ColorSettings: return "UI Color Settings"; - case Info: return "Info"; - case InfoMain: return "Info"; + case ColorSettings: return F("UI Color Settings"); + case Info: return F("Info"); + case InfoMain: return F("Info"); #if HAS_MESH - case Leveling: return "Leveling"; - case LevelView: return GET_TEXT(MSG_MESH_VIEW); - case LevelSettings: return "Leveling Settings"; - case MeshViewer: return GET_TEXT(MSG_MESH_VIEW); - case LevelManual: return "Manual Tuning"; + case Leveling: return F("Leveling"); + case LevelView: return GET_TEXT_F(MSG_MESH_VIEW); + case LevelSettings: return F("Leveling Settings"); + case MeshViewer: return GET_TEXT_F(MSG_MESH_VIEW); + case LevelManual: return F("Manual Tuning"); #endif #if ENABLED(AUTO_BED_LEVELING_UBL) && !HAS_BED_PROBE - case UBLMesh: return "UBL Bed Leveling"; + case UBLMesh: return F("UBL Bed Leveling"); #endif #if ENABLED(PROBE_MANUALLY) - case ManualMesh: return "Mesh Bed Leveling"; + case ManualMesh: return F("Mesh Bed Leveling"); #endif - case Tune: return "Tune"; - case PreheatHotend: return "Preheat Hotend"; + case Tune: return F("Tune"); + case PreheatHotend: return F("Preheat Hotend"); } - return ""; + return F(""); } uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) { @@ -4168,25 +4184,25 @@ uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) { void CrealityDWINClass::Popup_Handler(PopupID popupid, bool option/*=false*/) { popup = last_popup = popupid; switch (popupid) { - case Pause: Draw_Popup(PSTR("Pause Print"), PSTR(""), PSTR(""), Popup); break; - case Stop: Draw_Popup(PSTR("Stop Print"), PSTR(""), PSTR(""), Popup); break; - case Resume: Draw_Popup(PSTR("Resume Print?"), PSTR("Looks Like the last"), PSTR("print was interupted."), Popup); break; - case ConfFilChange: Draw_Popup(PSTR("Confirm Filament Change"), PSTR(""), PSTR(""), Popup); break; - case PurgeMore: Draw_Popup(PSTR("Purge more filament?"), PSTR("(Cancel to finish process)"), PSTR(""), Popup); break; - case SaveLevel: Draw_Popup(PSTR("Leveling Complete"), PSTR("Save to EEPROM?"), PSTR(""), Popup); break; - case MeshSlot: Draw_Popup(PSTR("Mesh slot not selected"), PSTR("(Confirm to select slot 0)"), PSTR(""), Popup); break; - case ETemp: Draw_Popup(PSTR("Nozzle is too cold"), PSTR("Open Preheat Menu?"), PSTR(""), Popup); break; - case ManualProbing: Draw_Popup(PSTR("Manual Probing"), PSTR("(Confirm to probe)"), PSTR("(cancel to exit)"), Popup); break; - case Level: Draw_Popup(PSTR("Auto Bed Leveling"), PSTR("Please wait until done."), PSTR(""), Wait, ICON_AutoLeveling); break; - case Home: Draw_Popup(option ? PSTR("Parking") : PSTR("Homing"), PSTR("Please wait until done."), PSTR(""), Wait, ICON_BLTouch); break; - case MoveWait: Draw_Popup(PSTR("Moving to Point"), PSTR("Please wait until done."), PSTR(""), Wait, ICON_BLTouch); break; - case Heating: Draw_Popup(PSTR("Heating"), PSTR("Please wait until done."), PSTR(""), Wait, ICON_BLTouch); break; - case FilLoad: Draw_Popup(option ? PSTR("Unloading Filament") : PSTR("Loading Filament"), PSTR("Please wait until done."), PSTR(""), Wait, ICON_BLTouch); break; - case FilChange: Draw_Popup(PSTR("Filament Change"), PSTR("Please wait for prompt."), PSTR(""), Wait, ICON_BLTouch); break; - case TempWarn: Draw_Popup(option ? PSTR("Nozzle temp too low!") : PSTR("Nozzle temp too high!"), PSTR(""), PSTR(""), Wait, option ? ICON_TempTooLow : ICON_TempTooHigh); break; - case Runout: Draw_Popup(PSTR("Filament Runout"), PSTR(""), PSTR(""), Wait, ICON_BLTouch); break; - case PIDWait: Draw_Popup(PSTR("PID Autotune"), PSTR("in process"), PSTR("Please wait until done."), Wait, ICON_BLTouch); break; - case Resuming: Draw_Popup(PSTR("Resuming Print"), PSTR("Please wait until done."), PSTR(""), Wait, ICON_BLTouch); break; + case Pause: Draw_Popup(F("Pause Print"), F(""), F(""), Popup); break; + case Stop: Draw_Popup(F("Stop Print"), F(""), F(""), Popup); break; + case Resume: Draw_Popup(F("Resume Print?"), F("Looks Like the last"), F("print was interupted."), Popup); break; + case ConfFilChange: Draw_Popup(F("Confirm Filament Change"), F(""), F(""), Popup); break; + case PurgeMore: Draw_Popup(F("Purge more filament?"), F("(Cancel to finish process)"), F(""), Popup); break; + case SaveLevel: Draw_Popup(F("Leveling Complete"), F("Save to EEPROM?"), F(""), Popup); break; + case MeshSlot: Draw_Popup(F("Mesh slot not selected"), F("(Confirm to select slot 0)"), F(""), Popup); break; + case ETemp: Draw_Popup(F("Nozzle is too cold"), F("Open Preheat Menu?"), F(""), Popup); break; + case ManualProbing: Draw_Popup(F("Manual Probing"), F("(Confirm to probe)"), F("(cancel to exit)"), Popup); break; + case Level: Draw_Popup(F("Auto Bed Leveling"), F("Please wait until done."), F(""), Wait, ICON_AutoLeveling); break; + case Home: Draw_Popup(option ? F("Parking") : F("Homing"), F("Please wait until done."), F(""), Wait, ICON_BLTouch); break; + case MoveWait: Draw_Popup(F("Moving to Point"), F("Please wait until done."), F(""), Wait, ICON_BLTouch); break; + case Heating: Draw_Popup(F("Heating"), F("Please wait until done."), F(""), Wait, ICON_BLTouch); break; + case FilLoad: Draw_Popup(option ? F("Unloading Filament") : F("Loading Filament"), F("Please wait until done."), F(""), Wait, ICON_BLTouch); break; + case FilChange: Draw_Popup(F("Filament Change"), F("Please wait for prompt."), F(""), Wait, ICON_BLTouch); break; + case TempWarn: Draw_Popup(option ? F("Nozzle temp too low!") : F("Nozzle temp too high!"), F(""), F(""), Wait, option ? ICON_TempTooLow : ICON_TempTooHigh); break; + case Runout: Draw_Popup(F("Filament Runout"), F(""), F(""), Wait, ICON_BLTouch); break; + case PIDWait: Draw_Popup(F("PID Autotune"), F("in process"), F("Please wait until done."), Wait, ICON_BLTouch); break; + case Resuming: Draw_Popup(F("Resuming Print"), F("Please wait until done."), F(""), Wait, ICON_BLTouch); break; default: break; } } @@ -4194,11 +4210,11 @@ void CrealityDWINClass::Popup_Handler(PopupID popupid, bool option/*=false*/) { void CrealityDWINClass::Confirm_Handler(PopupID popupid) { popup = popupid; switch (popupid) { - case FilInsert: Draw_Popup(PSTR("Insert Filament"), PSTR("Press to Continue"), PSTR(""), Confirm); break; - case HeaterTime: Draw_Popup(PSTR("Heater Timed Out"), PSTR("Press to Reheat"), PSTR(""), Confirm); break; - case UserInput: Draw_Popup(PSTR("Waiting for Input"), PSTR("Press to Continue"), PSTR(""), Confirm); break; - case LevelError: Draw_Popup(PSTR("Couldn't enable Leveling"), PSTR("(Valid mesh must exist)"), PSTR(""), Confirm); break; - case InvalidMesh: Draw_Popup(PSTR("Valid mesh must exist"), PSTR("before tuning can be"), PSTR("performed"), Confirm); break; + case FilInsert: Draw_Popup(F("Insert Filament"), F("Press to Continue"), F(""), Confirm); break; + case HeaterTime: Draw_Popup(F("Heater Timed Out"), F("Press to Reheat"), F(""), Confirm); break; + case UserInput: Draw_Popup(F("Waiting for Input"), F("Press to Continue"), F(""), Confirm); break; + case LevelError: Draw_Popup(F("Couldn't enable Leveling"), F("(Valid mesh must exist)"), F(""), Confirm); break; + case InvalidMesh: Draw_Popup(F("Valid mesh must exist"), F("before tuning can be"), F("performed"), Confirm); break; default: break; } } diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index 92470c2f0e..0157f673ce 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -175,7 +175,9 @@ public: static uint16_t GetColor(uint8_t color, uint16_t original, bool light=false); static void Draw_Checkbox(uint8_t row, bool value); static void Draw_Title(const char * title); + static void Draw_Title(FSTR_P const title); static void Draw_Menu_Item(uint8_t row, uint8_t icon=0, const char * const label1=nullptr, const char * const label2=nullptr, bool more=false, bool centered=false); + static void Draw_Menu_Item(uint8_t row, uint8_t icon=0, FSTR_P const flabel1=nullptr, FSTR_P const flabel2=nullptr, bool more=false, bool centered=false); static void Draw_Menu(uint8_t menu, uint8_t select=0, uint8_t scroll=0); static void Redraw_Menu(bool lastprocess=true, bool lastselection=false, bool lastmenu=false); static void Redraw_Screen(); @@ -194,7 +196,7 @@ public: static void Draw_SD_Item(uint8_t item, uint8_t row); static void Draw_SD_List(bool removed=false); static void Draw_Status_Area(bool icons=false); - static void Draw_Popup(PGM_P const line1, PGM_P const line2, PGM_P const line3, uint8_t mode, uint8_t icon=0); + static void Draw_Popup(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, uint8_t mode, uint8_t icon=0); static void Popup_Select(); static void Update_Status_Bar(bool refresh=false); @@ -203,7 +205,7 @@ public: static void Set_Mesh_Viewer_Status(); #endif - static const char * Get_Menu_Title(uint8_t menu); + static FSTR_P Get_Menu_Title(uint8_t menu); static uint8_t Get_Menu_Size(uint8_t menu); static void Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw=true);