From d0ba17d871920d737d69bfb4214b03fd615e70fc Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 22 Nov 2024 10:50:40 -0500 Subject: [PATCH 1/8] update HAS_DISPLAY, DWIN_CREALITY_LCD --- Marlin/src/gcode/gcode.h | 9 ++++--- Marlin/src/inc/Conditionals-2-LCD.h | 11 ++------ Marlin/src/lcd/e3v2/common/dwin_set.h | 16 +++++++++++ Marlin/src/lcd/e3v2/creality/dwin.cpp | 18 +++++++++---- Marlin/src/lcd/e3v2/proui/dwinui.h | 16 ----------- Marlin/src/lcd/marlinui.h | 38 +++++++++++---------------- Marlin/src/module/planner.cpp | 9 ++++--- 7 files changed, 58 insertions(+), 59 deletions(-) diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 589cd2bc486c..f8dc268f798b 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -163,10 +163,11 @@ * M123 - Report fan tachometers. (Requires En_FAN_TACHO_PIN) Optionally set auto-report interval. (Requires AUTO_REPORT_FANS) * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE) * - * M126 - Solenoid Air Valve Open. (Requires BARICUDA) - * M127 - Solenoid Air Valve Closed. (Requires BARICUDA) - * M128 - EtoP Open. (Requires BARICUDA) - * M129 - EtoP Closed. (Requires BARICUDA) + *** BARICUDA *** + * M126 - Solenoid Air Valve Open. + * M127 - Solenoid Air Valve Closed. + * M128 - EtoP Open. + * M129 - EtoP Closed. * * M140 - Set bed target temp. S * M141 - Set heated chamber target temp. S (Requires a chamber heater) diff --git a/Marlin/src/inc/Conditionals-2-LCD.h b/Marlin/src/inc/Conditionals-2-LCD.h index e7ea7bdeaf3b..ca70ef0e523a 100644 --- a/Marlin/src/inc/Conditionals-2-LCD.h +++ b/Marlin/src/inc/Conditionals-2-LCD.h @@ -585,7 +585,7 @@ #endif #endif -#if ANY(HAS_WIRED_LCD, EXTENSIBLE_UI, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) +#if ANY(HAS_WIRED_LCD, EXTENSIBLE_UI, HAS_DWIN_E3V2) /** * HAS_DISPLAY indicates the display uses these MarlinUI methods... * - update @@ -605,10 +605,7 @@ * (calling advance_status_scroll, status_and_len for a scrolling status message) */ #define HAS_DISPLAY 1 -#endif - -#if ANY(HAS_DISPLAY, DWIN_CREALITY_LCD) - #define HAS_UI_UPDATE 1 + #define HAS_STATUS_MESSAGE 1 #endif #if HAS_WIRED_LCD && !HAS_GRAPHICAL_TFT && !IS_DWIN_MARLINUI @@ -619,10 +616,6 @@ #define HAS_UTF8_UTILS 1 #endif -#if ANY(HAS_DISPLAY, HAS_DWIN_E3V2) - #define HAS_STATUS_MESSAGE 1 -#endif - #if IS_ULTIPANEL && DISABLED(NO_LCD_MENUS) #define HAS_MARLINUI_MENU 1 #endif diff --git a/Marlin/src/lcd/e3v2/common/dwin_set.h b/Marlin/src/lcd/e3v2/common/dwin_set.h index f32d0e6d9e43..644efb40ba92 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_set.h +++ b/Marlin/src/lcd/e3v2/common/dwin_set.h @@ -128,6 +128,22 @@ #define ICON_Info_0 90 #define ICON_Info_1 91 +// Extra Icons +#define ICON_Printer_0 93 +#define ICON_Box 200 +#define ICON_Checkbox 201 +#define ICON_Fade 202 +#define ICON_Mesh 203 +#define ICON_Tilt 204 +#define ICON_Brightness 205 +#define ICON_Probe 206 +#define ICON_AxisD 249 +#define ICON_AxisBR 250 +#define ICON_AxisTR 251 +#define ICON_AxisBL 252 +#define ICON_AxisTL 253 +#define ICON_AxisC 254 + #define ICON_Folder ICON_More #define ICON_AdvSet ICON_Language #define ICON_HomeOffset ICON_PrintSize diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 34bdd29694a4..0fda1ba490e1 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -357,6 +357,10 @@ void clearPopupArea() { dwinDrawRectangle(1, COLOR_BG_BLACK, 0, 31, DWIN_WIDTH, DWIN_HEIGHT); } +void drawPopupBkgd60() { + dwinDrawRectangle(1, COLOR_BG_WINDOW, 14, 60, 258, 330); +} + void drawPopupBkgd105() { dwinDrawRectangle(1, COLOR_BG_WINDOW, 14, 105, 258, 374); } @@ -1083,10 +1087,6 @@ void drawMotionMenu() { #endif -void drawPopupBkgd60() { - dwinDrawRectangle(1, COLOR_BG_WINDOW, 14, 60, 258, 330); -} - #if HAS_HOTEND void popupWindowETempTooLow() { @@ -1127,7 +1127,7 @@ void popupWindowResume() { void popupWindowHome(const bool parking/*=false*/) { clearMainWindow(); drawPopupBkgd60(); - dwinIconShow(ICON, ICON_BLTouch, 101, 105); + dwinIconShow(ICON, ICON_Printer_0, 101, 105); if (hmiIsChinese()) { dwinFrameAreaCopy(1, 0, 371, 33, 386, 85, 240); // Wait for Move to Complete dwinFrameAreaCopy(1, 203, 286, 271, 302, 118, 240); @@ -1828,6 +1828,14 @@ void MarlinUI::update() { void MarlinUI::_set_brightness() { dwinLCDBrightness(backlight ? brightness : 0); } #endif +void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const) { + clearMainWindow(); + drawPopupBkgd60(); + dwinIconShow(ICON, ICON_Printer_0, 101, 105); + dwinDrawString(true, font8x16, COLOR_POPUP_TEXT, COLOR_BG_WINDOW, (272 - 8 * 15) / 2, 230, GET_TEXT_F(MSG_PRINTER_KILLED)); + dwinDrawString(true, font8x16, COLOR_POPUP_TEXT, COLOR_BG_WINDOW, (272 - 8 * 20) / 2, 260, GET_TEXT_F(MSG_TURN_OFF)); +} + #if ENABLED(SCROLL_LONG_FILENAMES) char shift_name[LONG_FILENAME_LENGTH + 1]; diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index f606c2440010..0c98fc0d920c 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -36,22 +36,6 @@ #include "../common/dwin_color.h" #include "dwin_lcd.h" -// Extra Icons -#define ICON_Printer_0 93 -#define ICON_Box 200 -#define ICON_Checkbox 201 -#define ICON_Fade 202 -#define ICON_Mesh 203 -#define ICON_Tilt 204 -#define ICON_Brightness 205 -#define ICON_Probe 206 -#define ICON_AxisD 249 -#define ICON_AxisBR 250 -#define ICON_AxisTR 251 -#define ICON_AxisBL 252 -#define ICON_AxisTL 253 -#define ICON_AxisC 254 - #define ICON_BedSizeX ICON_PrintSize #define ICON_BedSizeY ICON_PrintSize #define ICON_BedTramming ICON_SetHome diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 64c64020ed99..a4cde1b4099f 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -205,23 +205,6 @@ class MarlinUI { static void init(); - #if HAS_DISPLAY || HAS_DWIN_E3V2 - static void init_lcd(); - // Erase the LCD contents. Do the lowest-level thing required to clear the LCD. - static void clear_lcd(); - #else - static void init_lcd() {} - static void clear_lcd() {} - #endif - - static void reinit_lcd() { TERN_(REINIT_NOISY_LCD, init_lcd()); } - - #if HAS_WIRED_LCD - static bool detected(); - #else - static bool detected() { return true; } - #endif - #if HAS_MULTI_LANGUAGE static uint8_t language; static void set_language(const uint8_t lang); @@ -499,8 +482,8 @@ class MarlinUI { * @param cstr A C-string to set as the status. */ static void set_status_no_expire_P(PGM_P const pstr) { set_status_P(pstr, true); } - static void set_status_no_expire(const char * const cstr) { set_status(cstr, true); } - static void set_status_no_expire(FSTR_P const fstr) { set_status(fstr, true); } + static void set_status_no_expire(const char * const cstr) { set_status(cstr, true); } + static void set_status_no_expire(FSTR_P const fstr) { set_status(fstr, true); } /** * @brief Set a status with a format string and parameters. @@ -512,9 +495,6 @@ class MarlinUI { template static void status_printf(int8_t level, FSTR_P const ffmt, Args... more) { status_printf_P(level, FTOP(ffmt), more...); } - // Periodic or as-needed display update - static void update() IF_DISABLED(HAS_UI_UPDATE, {}); - // Tell the screen to redraw on the next call FORCE_INLINE static void refresh() { TERN_(HAS_WIRED_LCD, refresh(LCDVIEW_CLEAR_CALL_REDRAW)); @@ -522,6 +502,14 @@ class MarlinUI { #if HAS_DISPLAY + // Periodic or as-needed display update + static void update(); + + static void init_lcd(); + + // Erase the LCD contents. Do the lowest-level thing required to clear the LCD. + static void clear_lcd(); + // Clear the LCD before new drawing. Some LCDs do nothing because they redraw frequently. static void clear_for_drawing(); @@ -635,11 +623,17 @@ class MarlinUI { #else // No LCD + static void update() {} + static void init_lcd() {} + static void clear_lcd() {} static void clear_for_drawing() {} static void kill_screen(FSTR_P const, FSTR_P const) {} #endif + static bool detected() IF_DISABLED(HAS_WIRED_LCD, { return true; }); + static void reinit_lcd() { TERN_(REINIT_NOISY_LCD, init_lcd()); } + #if !HAS_WIRED_LCD static void quick_feedback(const bool=true) {} #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 630557180ba2..ad16361aa338 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2149,9 +2149,12 @@ bool Planner::_populate_block( #endif #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) SECONDARY_AXIS_CODE( - if (block->steps.i) stepper.enable_axis(I_AXIS), if (block->steps.j) stepper.enable_axis(J_AXIS), - if (block->steps.k) stepper.enable_axis(K_AXIS), if (block->steps.u) stepper.enable_axis(U_AXIS), - if (block->steps.v) stepper.enable_axis(V_AXIS), if (block->steps.w) stepper.enable_axis(W_AXIS) + if (block->steps.i) stepper.enable_axis(I_AXIS), + if (block->steps.j) stepper.enable_axis(J_AXIS), + if (block->steps.k) stepper.enable_axis(K_AXIS), + if (block->steps.u) stepper.enable_axis(U_AXIS), + if (block->steps.v) stepper.enable_axis(V_AXIS), + if (block->steps.w) stepper.enable_axis(W_AXIS) ); #endif From 7144f308c2f83aae22569b439ad41dcbf11f698c Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sat, 23 Nov 2024 16:44:21 -0500 Subject: [PATCH 2/8] fix creality string centering --- Marlin/src/lcd/e3v2/creality/dwin.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 0fda1ba490e1..08853c5cc145 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -1118,7 +1118,7 @@ void popupWindowResume() { else { dwinDrawString(true, font8x16, COLOR_POPUP_TEXT, COLOR_BG_WINDOW, (272 - 8 * 14) / 2, 115, F("Continue Print")); dwinDrawString(true, font8x16, COLOR_POPUP_TEXT, COLOR_BG_WINDOW, (272 - 8 * 22) / 2, 192, F("It looks like the last")); - dwinDrawString(true, font8x16, COLOR_POPUP_TEXT, COLOR_BG_WINDOW, (272 - 8 * 22) / 2, 212, F("file was interrupted.")); + dwinDrawString(true, font8x16, COLOR_POPUP_TEXT, COLOR_BG_WINDOW, (272 - 8 * 21) / 2, 212, F("file was interrupted.")); dwinIconShow(ICON, ICON_Cancel_E, 26, 307); dwinIconShow(ICON, ICON_Continue_E, 146, 307); } @@ -1150,7 +1150,7 @@ void popupWindowHome(const bool parking/*=false*/) { dwinFrameAreaCopy(1, 0, 389, 150, 402, 61, 280); } else { - dwinDrawString(true, font8x16, COLOR_POPUP_TEXT, COLOR_BG_WINDOW, (272 - 8 * 13) / 2, 230, GET_TEXT_F(MSG_BED_LEVELING)); + dwinDrawString(true, font8x16, COLOR_POPUP_TEXT, COLOR_BG_WINDOW, (272 - 8 * 12) / 2, 230, GET_TEXT_F(MSG_BED_LEVELING)); dwinDrawString(true, font8x16, COLOR_POPUP_TEXT, COLOR_BG_WINDOW, (272 - 8 * 23) / 2, 260, F("Please wait until done.")); } } @@ -1171,8 +1171,8 @@ void popupwindowPauseOrStop() { clearMainWindow(); drawPopupBkgd60(); if (hmiIsChinese()) { - if (select_print.now == PRINT_PAUSE_RESUME) dwinFrameAreaCopy(1, 237, 338, 269, 356, 98, 150); // Pause - else if (select_print.now == PRINT_STOP) dwinFrameAreaCopy(1, 221, 320, 253, 336, 98, 150); // Stop + if (select_print.now == PRINT_PAUSE_RESUME) dwinFrameAreaCopy(1, 237, 338, 269, 356, 98, 150); // Pause + else if (select_print.now == PRINT_STOP) dwinFrameAreaCopy(1, 221, 320, 253, 336, 98, 150); // Stop dwinFrameAreaCopy(1, 220, 304, 264, 319, 130, 150); // Print dwinIconShow(ICON, ICON_Confirm_C, 26, 280); dwinIconShow(ICON, ICON_Cancel_C, 146, 280); From c1cba7ad89696e116cf078518ce4ec10261d28ce Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 25 Nov 2024 10:52:10 -0500 Subject: [PATCH 3/8] update endstops.cpp --- Marlin/src/module/endstops.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 85e021d661ea..70c85880a9d3 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -27,9 +27,10 @@ #include "endstops.h" #include "stepper.h" -#include "../sd/cardreader.h" -#include "temperature.h" -#include "../lcd/marlinui.h" +#if HAS_STATUS_MESSAGE + #include "../lcd/marlinui.h" +#endif + #if ENABLED(SOVOL_SV06_RTS) #include "../lcd/sovol_rts/sovol_rts.h" #endif @@ -44,6 +45,8 @@ #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) #include "printcounter.h" // for print_job_timer + #include "temperature.h" + #include "../sd/cardreader.h" #endif #if ENABLED(BLTOUCH) @@ -58,6 +61,10 @@ #include "probe.h" #endif +#if HAS_FILAMENT_SENSOR + #include "../feature/runout.h" +#endif + #define DEBUG_OUT ALL(USE_SENSORLESS, DEBUG_LEVELING_FEATURE) #include "../core/debug_out.h" @@ -375,13 +382,13 @@ void Endstops::event_handler() { #endif SERIAL_EOL(); - TERN_(HAS_STATUS_MESSAGE, + #if HAS_STATUS_MESSAGE ui.status_printf(0, F(S_FMT GANG_N_1(NUM_AXES, " %c") " %c"), GET_TEXT_F(MSG_LCD_ENDSTOPS), NUM_AXIS_LIST_(chrX, chrY, chrZ, chrI, chrJ, chrK, chrU, chrV, chrW) chrP - ) - ); + ); + #endif #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) if (planner.abort_on_endstop_hit) { @@ -526,7 +533,7 @@ void __O2 Endstops::report_states() { } #undef _CASE_RUNOUT #elif HAS_FILAMENT_SENSOR - print_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE, F(STR_FILAMENT)); + print_es_state(!FILAMENT_IS_OUT()); #endif TERN_(BLTOUCH, bltouch._reset_SW_mode()); From f4c8f2032a3a2d85de4e1b86309d1caa771a44fd Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 25 Nov 2024 11:32:48 -0500 Subject: [PATCH 4/8] revert cosmetic to other PR --- Marlin/src/gcode/gcode.h | 9 ++++----- Marlin/src/lcd/marlinui.h | 38 ++++++++++++++++++++--------------- Marlin/src/module/planner.cpp | 9 +++------ 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index f8dc268f798b..589cd2bc486c 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -163,11 +163,10 @@ * M123 - Report fan tachometers. (Requires En_FAN_TACHO_PIN) Optionally set auto-report interval. (Requires AUTO_REPORT_FANS) * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE) * - *** BARICUDA *** - * M126 - Solenoid Air Valve Open. - * M127 - Solenoid Air Valve Closed. - * M128 - EtoP Open. - * M129 - EtoP Closed. + * M126 - Solenoid Air Valve Open. (Requires BARICUDA) + * M127 - Solenoid Air Valve Closed. (Requires BARICUDA) + * M128 - EtoP Open. (Requires BARICUDA) + * M129 - EtoP Closed. (Requires BARICUDA) * * M140 - Set bed target temp. S * M141 - Set heated chamber target temp. S (Requires a chamber heater) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index a4cde1b4099f..64c64020ed99 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -205,6 +205,23 @@ class MarlinUI { static void init(); + #if HAS_DISPLAY || HAS_DWIN_E3V2 + static void init_lcd(); + // Erase the LCD contents. Do the lowest-level thing required to clear the LCD. + static void clear_lcd(); + #else + static void init_lcd() {} + static void clear_lcd() {} + #endif + + static void reinit_lcd() { TERN_(REINIT_NOISY_LCD, init_lcd()); } + + #if HAS_WIRED_LCD + static bool detected(); + #else + static bool detected() { return true; } + #endif + #if HAS_MULTI_LANGUAGE static uint8_t language; static void set_language(const uint8_t lang); @@ -482,8 +499,8 @@ class MarlinUI { * @param cstr A C-string to set as the status. */ static void set_status_no_expire_P(PGM_P const pstr) { set_status_P(pstr, true); } - static void set_status_no_expire(const char * const cstr) { set_status(cstr, true); } - static void set_status_no_expire(FSTR_P const fstr) { set_status(fstr, true); } + static void set_status_no_expire(const char * const cstr) { set_status(cstr, true); } + static void set_status_no_expire(FSTR_P const fstr) { set_status(fstr, true); } /** * @brief Set a status with a format string and parameters. @@ -495,6 +512,9 @@ class MarlinUI { template static void status_printf(int8_t level, FSTR_P const ffmt, Args... more) { status_printf_P(level, FTOP(ffmt), more...); } + // Periodic or as-needed display update + static void update() IF_DISABLED(HAS_UI_UPDATE, {}); + // Tell the screen to redraw on the next call FORCE_INLINE static void refresh() { TERN_(HAS_WIRED_LCD, refresh(LCDVIEW_CLEAR_CALL_REDRAW)); @@ -502,14 +522,6 @@ class MarlinUI { #if HAS_DISPLAY - // Periodic or as-needed display update - static void update(); - - static void init_lcd(); - - // Erase the LCD contents. Do the lowest-level thing required to clear the LCD. - static void clear_lcd(); - // Clear the LCD before new drawing. Some LCDs do nothing because they redraw frequently. static void clear_for_drawing(); @@ -623,17 +635,11 @@ class MarlinUI { #else // No LCD - static void update() {} - static void init_lcd() {} - static void clear_lcd() {} static void clear_for_drawing() {} static void kill_screen(FSTR_P const, FSTR_P const) {} #endif - static bool detected() IF_DISABLED(HAS_WIRED_LCD, { return true; }); - static void reinit_lcd() { TERN_(REINIT_NOISY_LCD, init_lcd()); } - #if !HAS_WIRED_LCD static void quick_feedback(const bool=true) {} #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index ad16361aa338..630557180ba2 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2149,12 +2149,9 @@ bool Planner::_populate_block( #endif #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) SECONDARY_AXIS_CODE( - if (block->steps.i) stepper.enable_axis(I_AXIS), - if (block->steps.j) stepper.enable_axis(J_AXIS), - if (block->steps.k) stepper.enable_axis(K_AXIS), - if (block->steps.u) stepper.enable_axis(U_AXIS), - if (block->steps.v) stepper.enable_axis(V_AXIS), - if (block->steps.w) stepper.enable_axis(W_AXIS) + if (block->steps.i) stepper.enable_axis(I_AXIS), if (block->steps.j) stepper.enable_axis(J_AXIS), + if (block->steps.k) stepper.enable_axis(K_AXIS), if (block->steps.u) stepper.enable_axis(U_AXIS), + if (block->steps.v) stepper.enable_axis(V_AXIS), if (block->steps.w) stepper.enable_axis(W_AXIS) ); #endif From 89c6389e9e0816c3f25596c8e6ad7376b7ae1eb8 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 25 Nov 2024 11:40:01 -0500 Subject: [PATCH 5/8] fix --- Marlin/src/lcd/marlinui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 64c64020ed99..155869726ece 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -513,7 +513,7 @@ class MarlinUI { static void status_printf(int8_t level, FSTR_P const ffmt, Args... more) { status_printf_P(level, FTOP(ffmt), more...); } // Periodic or as-needed display update - static void update() IF_DISABLED(HAS_UI_UPDATE, {}); + static void update() IF_DISABLED(HAS_DISPLAY, {}); // Tell the screen to redraw on the next call FORCE_INLINE static void refresh() { From 0a37a127edc16328183ff4a255a5029b6f56124f Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Wed, 27 Nov 2024 22:28:29 -0500 Subject: [PATCH 6/8] arrange endstops --- Marlin/src/module/endstops.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 70c85880a9d3..57d6e0989dfe 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -57,14 +57,14 @@ #include "../feature/joystick.h" #endif -#if HAS_BED_PROBE - #include "probe.h" -#endif - #if HAS_FILAMENT_SENSOR #include "../feature/runout.h" #endif +#if HAS_BED_PROBE + #include "probe.h" +#endif + #define DEBUG_OUT ALL(USE_SENSORLESS, DEBUG_LEVELING_FEATURE) #include "../core/debug_out.h" From f2bb864ef7dbc88cad253ca335e32fc569066b5d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Dec 2024 17:39:21 -0600 Subject: [PATCH 7/8] keep HAS_UI_UPDATE --- Marlin/src/inc/Conditionals-2-LCD.h | 1 + Marlin/src/lcd/marlinui.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals-2-LCD.h b/Marlin/src/inc/Conditionals-2-LCD.h index ca70ef0e523a..0108fad02c48 100644 --- a/Marlin/src/inc/Conditionals-2-LCD.h +++ b/Marlin/src/inc/Conditionals-2-LCD.h @@ -605,6 +605,7 @@ * (calling advance_status_scroll, status_and_len for a scrolling status message) */ #define HAS_DISPLAY 1 + #define HAS_UI_UPDATE 1 #define HAS_STATUS_MESSAGE 1 #endif diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 155869726ece..64c64020ed99 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -513,7 +513,7 @@ class MarlinUI { static void status_printf(int8_t level, FSTR_P const ffmt, Args... more) { status_printf_P(level, FTOP(ffmt), more...); } // Periodic or as-needed display update - static void update() IF_DISABLED(HAS_DISPLAY, {}); + static void update() IF_DISABLED(HAS_UI_UPDATE, {}); // Tell the screen to redraw on the next call FORCE_INLINE static void refresh() { From 28afd34edddb7a3f2370def899fa1067a1cf5aaa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Dec 2024 19:39:28 -0600 Subject: [PATCH 8/8] other tweaks --- Marlin/src/lcd/marlinui.cpp | 14 +++++++------- Marlin/src/lcd/marlinui.h | 16 +++++++--------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index c625351d5a8e..2282cb5ee44c 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -55,10 +55,10 @@ MarlinUI ui; #endif #if ENABLED(LCD_PROGRESS_BAR) && !IS_TFTGLCD_PANEL - #define BASIC_PROGRESS_BAR 1 + #define HAS_BASIC_PROGRESS_BAR 1 #endif -#if ANY(HAS_DISPLAY, HAS_STATUS_MESSAGE, BASIC_PROGRESS_BAR) +#if ANY(HAS_DISPLAY, HAS_STATUS_MESSAGE, HAS_BASIC_PROGRESS_BAR) #include "../module/printcounter.h" #endif @@ -598,7 +598,7 @@ void MarlinUI::init() { * This is very display-dependent, so the lcd implementation draws this. */ - #if BASIC_PROGRESS_BAR + #if HAS_BASIC_PROGRESS_BAR millis_t MarlinUI::progress_bar_ms; // = 0 #if PROGRESS_MSG_EXPIRE > 0 millis_t MarlinUI::expire_status_ms; // = 0 @@ -607,7 +607,7 @@ void MarlinUI::init() { void MarlinUI::status_screen() { - #if BASIC_PROGRESS_BAR + #if HAS_BASIC_PROGRESS_BAR // // HD44780 implements the following message blinking and @@ -647,7 +647,7 @@ void MarlinUI::init() { #endif // PROGRESS_MSG_EXPIRE - #endif // BASIC_PROGRESS_BAR + #endif // HAS_BASIC_PROGRESS_BAR bool did_expire = status_reset_callback && (*status_reset_callback)(); @@ -1592,11 +1592,11 @@ void MarlinUI::host_notify(const char * const cstr) { #if HAS_WIRED_LCD - #if BASIC_PROGRESS_BAR || ALL(FILAMENT_LCD_DISPLAY, HAS_MEDIA) + #if HAS_BASIC_PROGRESS_BAR || ALL(FILAMENT_LCD_DISPLAY, HAS_MEDIA) const millis_t ms = millis(); #endif - #if BASIC_PROGRESS_BAR + #if HAS_BASIC_PROGRESS_BAR progress_bar_ms = ms; #if PROGRESS_MSG_EXPIRE > 0 expire_status_ms = persist ? 0 : ms + PROGRESS_MSG_EXPIRE; diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 64c64020ed99..3c4f28c93e81 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -205,15 +205,6 @@ class MarlinUI { static void init(); - #if HAS_DISPLAY || HAS_DWIN_E3V2 - static void init_lcd(); - // Erase the LCD contents. Do the lowest-level thing required to clear the LCD. - static void clear_lcd(); - #else - static void init_lcd() {} - static void clear_lcd() {} - #endif - static void reinit_lcd() { TERN_(REINIT_NOISY_LCD, init_lcd()); } #if HAS_WIRED_LCD @@ -522,6 +513,11 @@ class MarlinUI { #if HAS_DISPLAY + static void init_lcd(); + + // Erase the LCD contents. Do the lowest-level thing required to clear the LCD. + static void clear_lcd(); + // Clear the LCD before new drawing. Some LCDs do nothing because they redraw frequently. static void clear_for_drawing(); @@ -635,6 +631,8 @@ class MarlinUI { #else // No LCD + static void init_lcd() {} + static void clear_lcd() {} static void clear_for_drawing() {} static void kill_screen(FSTR_P const, FSTR_P const) {}