Skip to content

Commit

Permalink
♻️ No ui.reinit_lcd on any ExtUI (MarlinFirmware#23722)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
InsanityAutomation and thinkyhead authored Feb 13, 2022
1 parent e8cc050 commit 03516f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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();

Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/lcd/marlinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03516f0

Please sign in to comment.