Skip to content

Commit

Permalink
⚡️Reduce DISPLAY_SLEEP_MINUTES overhead (#26964)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuezas authored Apr 13, 2024
1 parent 9e88eb6 commit d99e150
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Marlin/src/lcd/dogm/marlinui_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,13 @@ void MarlinUI::draw_kill_screen() {
void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop

#if HAS_DISPLAY_SLEEP
void MarlinUI::sleep_display(const bool sleep/*=true*/) { sleep ? u8g.sleepOn() : u8g.sleepOff(); }
void MarlinUI::sleep_display(const bool sleep/*=true*/) {
static bool asleep = false;
if (asleep != sleep){
sleep ? u8g.sleepOn() : u8g.sleepOff();
asleep = sleep;
}
}
#endif

#if HAS_LCD_BRIGHTNESS
Expand Down

0 comments on commit d99e150

Please sign in to comment.