From 31a0f957fa9458dbf00e4ed0a8a0da4759476e3e Mon Sep 17 00:00:00 2001 From: Adrian DC Date: Sun, 25 Apr 2021 17:36:37 +0200 Subject: [PATCH] Fix E3V2 Advanced Settings without powerloss recovery (#21534) --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 51d192e26f00..9fdf401b5720 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -2381,10 +2381,12 @@ void Draw_AdvSet_Menu() { #endif if (AVISI(ADVSET_CASE_HEPID)) Draw_Menu_Line(ASCROL(ADVSET_CASE_HEPID), ICON_PIDNozzle, "Hotend PID", false); // Nozzle PID if (AVISI(ADVSET_CASE_BEDPID)) Draw_Menu_Line(ASCROL(ADVSET_CASE_BEDPID), ICON_PIDbed, "Bed PID", false); // Bed PID - if (AVISI(ADVSET_CASE_PWRLOSSR)) { - Draw_Menu_Line(ASCROL(ADVSET_CASE_PWRLOSSR), ICON_Motion, "Power-loss recovery", false); // Power-loss recovery - Draw_Chkb_Line(ASCROL(ADVSET_CASE_PWRLOSSR), recovery.enabled); - } + #if ENABLED(POWER_LOSS_RECOVERY) + if (AVISI(ADVSET_CASE_PWRLOSSR)) { + Draw_Menu_Line(ASCROL(ADVSET_CASE_PWRLOSSR), ICON_Motion, "Power-loss recovery", false); // Power-loss recovery + Draw_Chkb_Line(ASCROL(ADVSET_CASE_PWRLOSSR), recovery.enabled); + } + #endif if (select_advset.now) Draw_Menu_Cursor(ASCROL(select_advset.now)); } @@ -3409,10 +3411,12 @@ void HMI_AdvSet() { break; #endif - case ADVSET_CASE_PWRLOSSR: // Power-loss recovery - recovery.enable(!recovery.enabled); - Draw_Chkb_Line(ADVSET_CASE_PWRLOSSR + MROWS - index_advset, recovery.enabled); - break; + #if ENABLED(POWER_LOSS_RECOVERY) + case ADVSET_CASE_PWRLOSSR: // Power-loss recovery + recovery.enable(!recovery.enabled); + Draw_Chkb_Line(ADVSET_CASE_PWRLOSSR + MROWS - index_advset, recovery.enabled); + break; + #endif default: break; } }