Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HAS_DISPLAY, DWIN_CREALITY_LCD #27539

Open
wants to merge 2 commits into
base: bugfix-2.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<temp>
* M141 - Set heated chamber target temp. S<temp> (Requires a chamber heater)
Expand Down
11 changes: 2 additions & 9 deletions Marlin/src/inc/Conditionals-2-LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
16 changes: 16 additions & 0 deletions Marlin/src/lcd/e3v2/common/dwin_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 17 additions & 9 deletions Marlin/src/lcd/e3v2/creality/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -1083,10 +1087,6 @@ void drawMotionMenu() {

#endif

void drawPopupBkgd60() {
dwinDrawRectangle(1, COLOR_BG_WINDOW, 14, 60, 258, 330);
}

#if HAS_HOTEND

void popupWindowETempTooLow() {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
Expand All @@ -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."));
}
}
Expand All @@ -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);
Expand Down Expand Up @@ -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];
Expand Down
16 changes: 0 additions & 16 deletions Marlin/src/lcd/e3v2/proui/dwinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 16 additions & 22 deletions Marlin/src/lcd/marlinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand All @@ -512,16 +495,21 @@ class MarlinUI {
template<typename... Args>
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));
}

#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();

Expand Down Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions Marlin/src/module/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down