0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-22 17:52:57 +00:00

️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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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