🩹 Fix DGUS (MKS) compile (#24378)

This commit is contained in:
ellensp 2022-06-22 22:08:24 +12:00 committed by Scott Lahteine
parent 253e35e066
commit b7e1b6b893
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_(HAS_FILAMENT_SENSOR, runout.reset());
TERN(DWIN_LCD_PROUI, DWIN_Print_Resume(), ui.reset_status()); #if ENABLED(DWIN_LCD_PROUI)
TERN_(HAS_MARLINUI_MENU, ui.return_to_status()); DWIN_Print_Resume();
TERN_(DWIN_LCD_PROUI, HMI_ReturnScreen()); HMI_ReturnScreen();
#else
ui.reset_status();
ui.return_to_status();
#endif
} }
#endif // ADVANCED_PAUSE_FEATURE #endif // ADVANCED_PAUSE_FEATURE

View File

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

View File

@ -1018,13 +1018,13 @@
* LCD_SERIAL_PORT must be defined ahead of HAL.h * LCD_SERIAL_PORT must be defined ahead of HAL.h
*/ */
#ifndef LCD_SERIAL_PORT #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) #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 #define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423) #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423, MKS_ROBIN)
#define LCD_SERIAL_PORT 2 // Creality Ender3S1 board #define LCD_SERIAL_PORT 2 // Creality Ender3S1, MKS Robin
#else #else
#define LCD_SERIAL_PORT 3 // Creality 4.x board #define LCD_SERIAL_PORT 3 // Other boards
#endif #endif
#endif #endif
#ifdef LCD_SERIAL_PORT #ifdef LCD_SERIAL_PORT

View File

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

View File

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