Skip to content

Commit

Permalink
Fix indices
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 24, 2021
1 parent 8440d4c commit 7e66cb5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Marlin/src/lcd/dwin/e3v2/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const
DWIN_Draw_Line(Line_Color, 16, MBASE(line) + 33, 256, MBASE(line) + 34);
}

void Draw_Chkb_Line(const uint8_t line, bool mode){
void Draw_Chkb_Line(const uint8_t line, const bool mode) {
DWIN_Draw_Checkbox(Color_White, Color_Bg_Black, 225, MBASE(line) - 1, mode);
}

Expand Down Expand Up @@ -553,9 +553,9 @@ inline bool Apply_Encoder(const ENCODER_DiffState &encoder_diffState, auto &valr

#define ADVSET_CASE_HOMEOFF 1
#define ADVSET_CASE_PROBEOFF (ADVSET_CASE_HOMEOFF + ENABLED(HAS_ONESTEP_LEVELING))
#define ADVSET_CASE_HEPID (ADVSET_CASE_PROBEOFF + 1)
#define ADVSET_CASE_BEDPID (ADVSET_CASE_HEPID + 1)
#define ADVSET_CASE_PWRLOSSR (ADVSET_CASE_BEDPID + 1)
#define ADVSET_CASE_HEPID (ADVSET_CASE_PROBEOFF + ENABLED(HAS_HOTEND))
#define ADVSET_CASE_BEDPID (ADVSET_CASE_HEPID + ENABLED(HAS_HEATED_BED))
#define ADVSET_CASE_PWRLOSSR (ADVSET_CASE_BEDPID + ENABLED(POWER_LOSS_RECOVERY))
#define ADVSET_CASE_TOTAL ADVSET_CASE_PWRLOSSR

//
Expand Down Expand Up @@ -2375,8 +2375,10 @@ 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
if (AVISI(ADVSET_CASE_PWRLOSSR)) Draw_Chkb_Line(ASCROL(ADVSET_CASE_PWRLOSSR),recovery.enabled);
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 (select_advset.now) Draw_Menu_Cursor(ASCROL(select_advset.now));
}

Expand Down Expand Up @@ -3392,7 +3394,7 @@ void HMI_AdvSet() {
break;
case ADVSET_CASE_PWRLOSSR: // Power-loss recovery
recovery.enable(!recovery.enabled);
Draw_Chkb_Line(ADVSET_CASE_PWRLOSSR + MROWS - index_advset,recovery.enabled);
Draw_Chkb_Line(ADVSET_CASE_PWRLOSSR + MROWS - index_advset, recovery.enabled);
break;
default: break;
}
Expand Down

0 comments on commit 7e66cb5

Please sign in to comment.