🩹 Fix DGUS (MKS) compile (#24378)

This commit is contained in:
ellensp 2022-06-22 22:08:24 +12:00 committed by Scott Lahteine
parent 185fe5696c
commit 010fbcccf7
5 changed files with 23 additions and 19 deletions

View file

@ -711,9 +711,13 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
TERN_(HAS_FILAMENT_SENSOR, runout.reset());
TERN(DWIN_LCD_PROUI, DWIN_Print_Resume(), ui.reset_status());
TERN_(HAS_MARLINUI_MENU, ui.return_to_status());
TERN_(DWIN_LCD_PROUI, HMI_ReturnScreen());
#if ENABLED(DWIN_LCD_PROUI)
DWIN_Print_Resume();
HMI_ReturnScreen();
#else
ui.reset_status();
ui.return_to_status();
#endif
}
#endif // ADVANCED_PAUSE_FEATURE

View file

@ -513,7 +513,7 @@
#define HAS_LCDPRINT 1
#endif
#if ANY(HAS_DISPLAY, HAS_DWIN_E3V2)
#if HAS_DISPLAY || HAS_DWIN_E3V2
#define HAS_STATUS_MESSAGE 1
#endif

View file

@ -1003,13 +1003,13 @@
* LCD_SERIAL_PORT must be defined ahead of HAL.h
*/
#ifndef LCD_SERIAL_PORT
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI || HAS_DGUS_LCD
#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO)
#define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423)
#define LCD_SERIAL_PORT 2 // Creality Ender3S1 board
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423, MKS_ROBIN)
#define LCD_SERIAL_PORT 2 // Creality Ender3S1, MKS Robin
#else
#define LCD_SERIAL_PORT 3 // Creality 4.x board
#define LCD_SERIAL_PORT 3 // Other boards
#endif
#endif
#ifdef LCD_SERIAL_PORT

View file

@ -258,7 +258,7 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) {
) filelist.refresh();
}
void DGUSScreenHandler::SDPrintingFinished() {
void DGUSScreenHandlerMKS::SDPrintingFinished() {
if (DGUSAutoTurnOff) {
queue.exhaust();
gcode.process_subcommands_now(F("M81"));
@ -416,15 +416,15 @@ void DGUSScreenHandlerMKS::LanguageChange(DGUS_VP_Variable &var, void *val_ptr)
case MKS_SimpleChinese:
DGUS_LanguageDisplay(MKS_SimpleChinese);
mks_language_index = MKS_SimpleChinese;
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_Choose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_NoChoose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, (uint8_t)MKS_Language_Choose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, (uint8_t)MKS_Language_NoChoose);
settings.save();
break;
case MKS_English:
DGUS_LanguageDisplay(MKS_English);
mks_language_index = MKS_English;
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_NoChoose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_Choose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, (uint8_t)MKS_Language_NoChoose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, (uint8_t)MKS_Language_Choose);
settings.save();
break;
default: break;
@ -1125,7 +1125,6 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr)
#if ENABLED(BABYSTEPPING)
void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleLiveAdjustZ");
char babystep_buf[30];
float step = ZOffset_distance;
uint16_t flag = swap16(*(uint16_t*)val_ptr);
@ -1446,12 +1445,12 @@ bool DGUSScreenHandlerMKS::loop() {
void DGUSScreenHandlerMKS::LanguagePInit() {
switch (mks_language_index) {
case MKS_SimpleChinese:
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_Choose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_NoChoose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, (uint8_t)MKS_Language_Choose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, (uint8_t)MKS_Language_NoChoose);
break;
case MKS_English:
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_NoChoose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_Choose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, (uint8_t)MKS_Language_NoChoose);
dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, (uint8_t)MKS_Language_Choose);
break;
default:
break;

View file

@ -502,7 +502,6 @@ public:
#else // No LCD
static void update() {}
static void return_to_status() {}
static void kill_screen(FSTR_P const, FSTR_P const) {}
#endif
@ -609,6 +608,8 @@ public:
#else
static void return_to_status() {}
static constexpr bool on_status_screen() { return true; }
#if HAS_WIRED_LCD