diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h index f1071f6b0a..ed8178449d 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h @@ -108,14 +108,14 @@ private: static bool Initialized, no_reentrance; }; -#define GET_VARIABLE(f, t, V...) (&DGUSDisplay::GetVariable) -#define SET_VARIABLE(f, t, V...) (&DGUSDisplay::SetVariable) - extern DGUSDisplay dgusdisplay; // compile-time x^y constexpr float cpow(const float x, const int y) { return y == 0 ? 1.0 : x * cpow(x, y - 1); } +/// +const uint16_t* DGUSLCD_FindScreenVPMapList(uint8_t screen); + /// Find the flash address of a DGUS_VP_Variable for the VP. const DGUS_VP_Variable* DGUSLCD_FindVPVar(const uint16_t vp); diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp index 79f39f93d8..39cb6e2bef 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp @@ -41,7 +41,10 @@ uint16_t distanceToMove = 10; #endif -const uint16_t VPList_Boot[] PROGMEM = { VP_MARLIN_VERSION, 0x0000 }; +const uint16_t VPList_Boot[] PROGMEM = { + VP_MARLIN_VERSION, + 0x0000 +}; const uint16_t VPList_Main[] PROGMEM = { // VP_M117, for completeness, but it cannot be auto-uploaded. @@ -101,7 +104,7 @@ const uint16_t VPList_Status[] PROGMEM = { }; const uint16_t VPList_Status2[] PROGMEM = { - /* VP_M117, for completeness, but it cannot be auto-uploaded */ + // VP_M117, for completeness, but it cannot be auto-uploaded #if HAS_HOTEND VP_Flowrate_E0, #if HAS_MULTI_EXTRUDER @@ -286,28 +289,28 @@ const uint16_t VPList_Z_Offset[] PROGMEM = { }; const struct VPMapping VPMap[] PROGMEM = { - { DGUSLCD_SCREEN_BOOT, VPList_Boot }, - { DGUSLCD_SCREEN_MAIN, VPList_Main }, - { DGUSLCD_SCREEN_TEMPERATURE, VPList_Temp }, - { DGUSLCD_SCREEN_STATUS, VPList_Status }, - { DGUSLCD_SCREEN_STATUS2, VPList_Status2 }, - { DGUSLCD_SCREEN_PREHEAT, VPList_Preheat }, - { DGUSLCD_SCREEN_MANUALMOVE, VPList_ManualMove }, - { DGUSLCD_SCREEN_MANUALEXTRUDE, VPList_ManualExtrude }, - { DGUSLCD_SCREEN_FILAMENT_HEATING, VPList_Filament_heating }, - { DGUSLCD_SCREEN_FILAMENT_LOADING, VPList_Filament_load_unload }, - { DGUSLCD_SCREEN_FILAMENT_UNLOADING, VPList_Filament_load_unload }, + { DGUSLCD_SCREEN_BOOT, VPList_Boot }, + { DGUSLCD_SCREEN_MAIN, VPList_Main }, + { DGUSLCD_SCREEN_TEMPERATURE, VPList_Temp }, + { DGUSLCD_SCREEN_STATUS, VPList_Status }, + { DGUSLCD_SCREEN_STATUS2, VPList_Status2 }, + { DGUSLCD_SCREEN_PREHEAT, VPList_Preheat }, + { DGUSLCD_SCREEN_MANUALMOVE, VPList_ManualMove }, + { DGUSLCD_SCREEN_MANUALEXTRUDE, VPList_ManualExtrude }, + { DGUSLCD_SCREEN_FILAMENT_HEATING, VPList_Filament_heating }, + { DGUSLCD_SCREEN_FILAMENT_LOADING, VPList_Filament_load_unload }, + { DGUSLCD_SCREEN_FILAMENT_UNLOADING, VPList_Filament_load_unload }, { DGUSLCD_SCREEN_SDPRINTMANIPULATION, VPList_SD_PrintManipulation }, - { DGUSLCD_SCREEN_SDFILELIST, VPList_SDFileList }, - { DGUSLCD_SCREEN_SDPRINTTUNE, VPList_SDPrintTune }, - { DGUSLCD_SCREEN_WAITING, VPList_PIDTuningWaiting }, - { DGUSLCD_SCREEN_FLC_PREHEAT, VPList_FLCPreheat }, - { DGUSLCD_SCREEN_FLC_PRINTING, VPList_FLCPrinting }, - { DGUSLCD_SCREEN_Z_OFFSET, VPList_Z_Offset }, - { DGUSLCD_SCREEN_STEPPERMM, VPList_StepPerMM }, - { DGUSLCD_SCREEN_PID_E, VPList_PIDE0 }, - { DGUSLCD_SCREEN_PID_BED, VPList_PIDBED }, - { DGUSLCD_SCREEN_INFOS, VPList_Infos }, + { DGUSLCD_SCREEN_SDFILELIST, VPList_SDFileList }, + { DGUSLCD_SCREEN_SDPRINTTUNE, VPList_SDPrintTune }, + { DGUSLCD_SCREEN_WAITING, VPList_PIDTuningWaiting }, + { DGUSLCD_SCREEN_FLC_PREHEAT, VPList_FLCPreheat }, + { DGUSLCD_SCREEN_FLC_PRINTING, VPList_FLCPrinting }, + { DGUSLCD_SCREEN_Z_OFFSET, VPList_Z_Offset }, + { DGUSLCD_SCREEN_STEPPERMM, VPList_StepPerMM }, + { DGUSLCD_SCREEN_PID_E, VPList_PIDE0 }, + { DGUSLCD_SCREEN_PID_BED, VPList_PIDBED }, + { DGUSLCD_SCREEN_INFOS, VPList_Infos }, { 0 , nullptr } // List is terminated with an nullptr as table entry. }; diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp index 78828e14c5..0012a0e5e0 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp @@ -42,6 +42,8 @@ #if ENABLED(SDSUPPORT) + static ExtUI::FileList filelist; + void DGUSScreenHandler::DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr) { uint16_t touched_nr = (int16_t)swap16(*(uint16_t*)val_ptr) + top_file; if (touched_nr > filelist.count()) return; @@ -83,7 +85,7 @@ case 1: // Pause - GotoScreen(MKSLCD_SCREEN_PAUSE); + GotoScreen(DGUSLCD_SCREEN_SDPRINTMANIPULATION); if (!ExtUI::isPrintingFromMediaPaused()) { ExtUI::pausePrint(); //ExtUI::mks_pausePrint(); @@ -409,8 +411,15 @@ bool DGUSScreenHandler::loop() { if (!booted && TERN0(POWER_LOSS_RECOVERY, recovery.valid())) booted = true; - if (!booted && ELAPSED(ms, TERN(USE_MKS_GREEN_UI, 1000, BOOTSCREEN_TIMEOUT))) + if (!booted && ELAPSED(ms, BOOTSCREEN_TIMEOUT)) { booted = true; + + if (TERN0(POWER_LOSS_RECOVERY, recovery.valid())) + GotoScreen(DGUSLCD_SCREEN_POWER_LOSS); + else + GotoScreen(DGUSLCD_SCREEN_MAIN); + } + #endif return IsScreenComplete(); } diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp index 3d0e073e5c..f1f4308d22 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp @@ -47,7 +47,7 @@ const uint16_t VPList_Boot[] PROGMEM = { }; const uint16_t VPList_Main[] PROGMEM = { - /* VP_M117, for completeness, but it cannot be auto-uploaded. */ + // VP_M117, for completeness, but it cannot be auto-uploaded. #if HAS_HOTEND VP_T_E0_Is, VP_T_E0_Set, VP_E0_STATUS, #if HOTENDS >= 2 @@ -83,7 +83,7 @@ const uint16_t VPList_Temp[] PROGMEM = { }; const uint16_t VPList_Status[] PROGMEM = { - /* VP_M117, for completeness, but it cannot be auto-uploaded */ + // VP_M117, for completeness, but it cannot be auto-uploaded #if HAS_HOTEND VP_T_E0_Is, VP_T_E0_Set, #if HOTENDS >= 2 @@ -104,7 +104,7 @@ const uint16_t VPList_Status[] PROGMEM = { }; const uint16_t VPList_Status2[] PROGMEM = { - /* VP_M117, for completeness, but it cannot be auto-uploaded */ + // VP_M117, for completeness, but it cannot be auto-uploaded #if HAS_HOTEND VP_Flowrate_E0, #if HOTENDS >= 2 @@ -292,28 +292,28 @@ const uint16_t VPList_Z_Offset[] PROGMEM = { }; const struct VPMapping VPMap[] PROGMEM = { - { DGUSLCD_SCREEN_BOOT, VPList_Boot }, - { DGUSLCD_SCREEN_MAIN, VPList_Main }, - { DGUSLCD_SCREEN_TEMPERATURE, VPList_Temp }, - { DGUSLCD_SCREEN_STATUS, VPList_Status }, - { DGUSLCD_SCREEN_STATUS2, VPList_Status2 }, - { DGUSLCD_SCREEN_PREHEAT, VPList_Preheat }, - { DGUSLCD_SCREEN_MANUALMOVE, VPList_ManualMove }, - { DGUSLCD_SCREEN_Z_OFFSET, VPList_Z_Offset }, - { DGUSLCD_SCREEN_MANUALEXTRUDE, VPList_ManualExtrude }, - { DGUSLCD_SCREEN_FILAMENT_HEATING, VPList_Filament_heating }, - { DGUSLCD_SCREEN_FILAMENT_LOADING, VPList_Filament_load_unload }, - { DGUSLCD_SCREEN_FILAMENT_UNLOADING, VPList_Filament_load_unload }, + { DGUSLCD_SCREEN_BOOT, VPList_Boot }, + { DGUSLCD_SCREEN_MAIN, VPList_Main }, + { DGUSLCD_SCREEN_TEMPERATURE, VPList_Temp }, + { DGUSLCD_SCREEN_STATUS, VPList_Status }, + { DGUSLCD_SCREEN_STATUS2, VPList_Status2 }, + { DGUSLCD_SCREEN_PREHEAT, VPList_Preheat }, + { DGUSLCD_SCREEN_MANUALMOVE, VPList_ManualMove }, + { DGUSLCD_SCREEN_Z_OFFSET, VPList_Z_Offset }, + { DGUSLCD_SCREEN_MANUALEXTRUDE, VPList_ManualExtrude }, + { DGUSLCD_SCREEN_FILAMENT_HEATING, VPList_Filament_heating }, + { DGUSLCD_SCREEN_FILAMENT_LOADING, VPList_Filament_load_unload }, + { DGUSLCD_SCREEN_FILAMENT_UNLOADING, VPList_Filament_load_unload }, { DGUSLCD_SCREEN_SDPRINTMANIPULATION, VPList_SD_PrintManipulation }, - { DGUSLCD_SCREEN_SDFILELIST, VPList_SDFileList }, - { DGUSLCD_SCREEN_SDPRINTTUNE, VPList_SDPrintTune }, - { DGUSLCD_SCREEN_WAITING, VPList_PIDTuningWaiting }, - { DGUSLCD_SCREEN_FLC_PREHEAT, VPList_FLCPreheat }, - { DGUSLCD_SCREEN_FLC_PRINTING, VPList_FLCPrinting }, - { DGUSLCD_SCREEN_STEPPERMM, VPList_StepPerMM }, - { DGUSLCD_SCREEN_PID_E, VPList_PIDE0 }, - { DGUSLCD_SCREEN_PID_BED, VPList_PIDBED }, - { DGUSLCD_SCREEN_INFOS, VPList_Infos }, + { DGUSLCD_SCREEN_SDFILELIST, VPList_SDFileList }, + { DGUSLCD_SCREEN_SDPRINTTUNE, VPList_SDPrintTune }, + { DGUSLCD_SCREEN_WAITING, VPList_PIDTuningWaiting }, + { DGUSLCD_SCREEN_FLC_PREHEAT, VPList_FLCPreheat }, + { DGUSLCD_SCREEN_FLC_PRINTING, VPList_FLCPrinting }, + { DGUSLCD_SCREEN_STEPPERMM, VPList_StepPerMM }, + { DGUSLCD_SCREEN_PID_E, VPList_PIDE0 }, + { DGUSLCD_SCREEN_PID_BED, VPList_PIDBED }, + { DGUSLCD_SCREEN_INFOS, VPList_Infos }, { 0 , nullptr } // List is terminated with an nullptr as table entry. }; @@ -395,7 +395,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, ScreenHandler.HandleTemperatureChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_BED_CONTROL, &thermalManager.temp_bed.target, ScreenHandler.HandleHeaterControl, nullptr), VPHELPER(VP_BED_STATUS, &thermalManager.temp_bed.target, nullptr, ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), - #if ENABLED(PIDTEMP) + #if ENABLED(PIDTEMPBED) VPHELPER(VP_BED_PID_P, &thermalManager.temp_bed.pid.Kp, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), VPHELPER(VP_BED_PID_I, &thermalManager.temp_bed.pid.Ki, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), VPHELPER(VP_BED_PID_D, &thermalManager.temp_bed.pid.Kd, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), @@ -445,11 +445,11 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), - VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), VPHELPER(VP_SD_ResumePauseAbort, nullptr, ScreenHandler.DGUSLCD_SD_ResumePauseAbort, nullptr), VPHELPER(VP_SD_AbortPrintConfirmed, nullptr, ScreenHandler.DGUSLCD_SD_ReallyAbort, nullptr), VPHELPER(VP_SD_Print_Setting, nullptr, ScreenHandler.DGUSLCD_SD_PrintTune, nullptr), diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp index eab5e27507..2100febc32 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_HYPRECY) +#if ENABLED(DGUS_LCD_UI_HIPRECY) #include "../DGUSScreenHandler.h" @@ -42,6 +42,8 @@ #if ENABLED(SDSUPPORT) + static ExtUI::FileList filelist; + void DGUSScreenHandler::DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr) { uint16_t touched_nr = (int16_t)swap16(*(uint16_t*)val_ptr) + top_file; if (touched_nr > filelist.count()) return; @@ -415,4 +417,4 @@ bool DGUSScreenHandler::loop() { return IsScreenComplete(); } -#endif // DGUS_LCD_UI_HYPRECY +#endif // DGUS_LCD_UI_HIPRECY diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp index af57f3dccc..39d89fc174 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp @@ -50,7 +50,7 @@ const uint16_t VPList_Boot[] PROGMEM = { }; const uint16_t VPList_Main[] PROGMEM = { - /* VP_M117, for completeness, but it cannot be auto-uploaded. */ + // VP_M117, for completeness, but it cannot be auto-uploaded. 0x0000 }; @@ -68,7 +68,7 @@ const uint16_t VPList_Temp[] PROGMEM = { }; const uint16_t VPList_Status[] PROGMEM = { - /* VP_M117, for completeness, but it cannot be auto-uploaded */ + // VP_M117, for completeness, but it cannot be auto-uploaded #if HAS_HOTEND VP_T_E0_Is, VP_T_E0_Set, #if HOTENDS >= 2 @@ -162,8 +162,8 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { // Temperature Data #if HAS_HOTEND - VPHELPER(VP_T_E0_Is, nullptr, nullptr, SET_VARIABLE(getActualTemp_celsius, E0, long)), - VPHELPER(VP_T_E0_Set, nullptr, GET_VARIABLE(setTargetTemp_celsius, E0), SET_VARIABLE(getTargetTemp_celsius, E0)), + VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_Flowrate_E0, nullptr, ScreenHandler.HandleFlowRateChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_EPos, &destination.e, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), VPHELPER(VP_MOVE_E0, nullptr, ScreenHandler.HandleManualExtrude, nullptr), @@ -194,7 +194,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { #endif #endif #if HAS_HEATED_BED - VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>), VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, ScreenHandler.HandleTemperatureChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_BED_CONTROL, &thermalManager.temp_bed.target, ScreenHandler.HandleHeaterControl, nullptr), VPHELPER(VP_BED_STATUS, &thermalManager.temp_bed.target, nullptr, ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), @@ -247,11 +247,11 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), - VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), VPHELPER(VP_SD_ResumePauseAbort, nullptr, ScreenHandler.DGUSLCD_SD_ResumePauseAbort, nullptr), VPHELPER(VP_SD_AbortPrintConfirmed, nullptr, ScreenHandler.DGUSLCD_SD_ReallyAbort, nullptr), VPHELPER(VP_SD_Print_Setting, nullptr, ScreenHandler.DGUSLCD_SD_PrintTune, nullptr), diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h index 7885621d0b..06f0dcf001 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h @@ -24,17 +24,17 @@ #include "../DGUSDisplayDef.h" enum DGUSLCD_Screens : uint8_t { - DGUSLCD_SCREEN_BOOT = 0, - DGUSLCD_SCREEN_MAIN = 10, - DGUSLCD_SCREEN_TEMPERATURE = 20, - DGUSLCD_SCREEN_STATUS = 30, - DGUSLCD_SCREEN_STATUS2 = 32, - DGUSLCD_SCREEN_MANUALMOVE = 40, - DGUSLCD_SCREEN_MANUALEXTRUDE = 42, - DGUSLCD_SCREEN_FANANDFEEDRATE = 44, - DGUSLCD_SCREEN_FLOWRATES = 46, - DGUSLCD_SCREEN_SDFILELIST = 50, - DGUSLCD_SCREEN_SDPRINTMANIPULATION = 52, + DGUSLCD_SCREEN_BOOT = 0, + DGUSLCD_SCREEN_MAIN = 10, + DGUSLCD_SCREEN_TEMPERATURE = 20, + DGUSLCD_SCREEN_STATUS = 30, + DGUSLCD_SCREEN_STATUS2 = 32, + DGUSLCD_SCREEN_MANUALMOVE = 40, + DGUSLCD_SCREEN_MANUALEXTRUDE = 42, + DGUSLCD_SCREEN_FANANDFEEDRATE = 44, + DGUSLCD_SCREEN_FLOWRATES = 46, + DGUSLCD_SCREEN_SDFILELIST = 50, + DGUSLCD_SCREEN_SDPRINTMANIPULATION = 52, DGUSLCD_SCREEN_POWER_LOSS = 100, DGUSLCD_SCREEN_PREHEAT = 120, DGUSLCD_SCREEN_UTILITY = 110, diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp index 70efb355fc..827d74967a 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp @@ -85,7 +85,7 @@ case 1: // Pause - GotoScreen(MKSLCD_SCREEN_PAUSE); + GotoScreen(DGUSLCD_SCREEN_SDPRINTMANIPULATION); if (!ExtUI::isPrintingFromMediaPaused()) { ExtUI::pausePrint(); //ExtUI::mks_pausePrint(); @@ -411,9 +411,12 @@ bool DGUSScreenHandler::loop() { if (!booted && TERN0(POWER_LOSS_RECOVERY, recovery.valid())) booted = true; - if (!booted && ELAPSED(ms, TERN(USE_MKS_GREEN_UI, 1000, BOOTSCREEN_TIMEOUT))) + if (!booted && ELAPSED(ms, BOOTSCREEN_TIMEOUT)) { booted = true; + GotoScreen(TERN0(POWER_LOSS_RECOVERY, recovery.valid()) ? DGUSLCD_SCREEN_POWER_LOSS : DGUSLCD_SCREEN_MAIN); + } #endif + return IsScreenComplete(); }