From d99e150097ddfd9cf369c4643888622769e147fb Mon Sep 17 00:00:00 2001 From: David Buezas Date: Sat, 13 Apr 2024 18:54:25 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8FReduce=20DISPLAY=5FSLEEP=5FMI?= =?UTF-8?q?NUTES=20overhead=20(#26964)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index a96d8e300287..06a234d04d09 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -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