Skip to content

Commit

Permalink
🩹 Fix DGUS (MKS) compile (MarlinFirmware#24378)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and LCh-77 committed Jul 19, 2022
1 parent 7ae091b commit 319a49e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
10 changes: 7 additions & 3 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1018,13 +1018,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
Expand Down
19 changes: 9 additions & 10 deletions Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/lcd/marlinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,6 @@ class MarlinUI {
#else // No LCD

static void update() {}
static void return_to_status() {}
static void kill_screen(FSTR_P const, FSTR_P const) {}

#endif
Expand Down Expand Up @@ -609,6 +608,8 @@ class MarlinUI {

#else

static void return_to_status() {}

static constexpr bool on_status_screen() { return true; }

#if HAS_WIRED_LCD
Expand Down

0 comments on commit 319a49e

Please sign in to comment.