From 010fbcccf7fc2aa7c421fa5df1a9d1a32f477fcc Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 22 Jun 2022 22:08:24 +1200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20DGUS=20(MKS)=20compile=20(?= =?UTF-8?q?#24378)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/pause.cpp | 10 +++++++--- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/Conditionals_adv.h | 8 ++++---- .../lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 19 +++++++++---------- Marlin/src/lcd/marlinui.h | 3 ++- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index ac5852f91a..e9cb2df594 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -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 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 5b6313b19d..ac729d9fed 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -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 diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 0490f33eb0..a137b86e58 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -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 diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 18ac433b71..2d4fe2e29d 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -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; diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 66e5e0c261..8ae8a8b7f5 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -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