From 03516f05191b888b5378f0426bc86f41b6cb2d03 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sun, 13 Feb 2022 14:44:24 -0500 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20No=20ui.reinit=5Flcd=20on?= =?UTF-8?q?=20any=20ExtUI=20(#23722)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_post.h | 4 ++-- Marlin/src/lcd/marlinui.cpp | 6 ++---- Marlin/src/lcd/marlinui.h | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index b107ad03ae21..fa273cd32eaf 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -459,8 +459,8 @@ #endif -#if ANY(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI) || !PIN_EXISTS(SD_DETECT) - #define NO_LCD_REINIT 1 // Suppress LCD re-initialization +#if PIN_EXISTS(SD_DETECT) && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI) + #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion #endif /** diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 27965c1bd428..d0cc2a25b8a3 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -625,7 +625,7 @@ void MarlinUI::init() { next_filament_display = millis() + 5000UL; // Show status message for 5s #endif goto_screen(menu_main); - IF_DISABLED(NO_LCD_REINIT, init_lcd()); // May revive the LCD if static electricity killed it + reinit_lcd(); // Revive a noisy shared SPI LCD return; } @@ -1697,9 +1697,7 @@ void MarlinUI::init() { } } - #if PIN_EXISTS(SD_DETECT) && DISABLED(NO_LCD_REINIT) - init_lcd(); // Revive a noisy shared SPI LCD - #endif + reinit_lcd(); // Revive a noisy shared SPI LCD refresh(); diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 5885866e5bd6..17c246873788 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -209,6 +209,8 @@ class MarlinUI { static void init_lcd() {} #endif + static void reinit_lcd() { TERN_(REINIT_NOISY_LCD, init_lcd()); } + #if HAS_WIRED_LCD static bool detected(); #else