️Reduce DISPLAY_SLEEP_MINUTES overhead (#26964)

This commit is contained in:
David Buezas
2024-04-13 18:54:25 +02:00
committed by GitHub
parent 9e88eb6100
commit d99e150097

View File

@@ -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