diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index e46a3af2de..94980a28e4 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1782,6 +1782,12 @@ */ //#define SD_SPI_SPEED SPI_HALF_SPEED + /** + * Reinit the LCD after SD Card insert/remove or when entering the menu. + * Required for some LCDs that use shared SPI with an external SD Card reader. + */ + #define REINIT_NOISY_LCD + // The standard SD detect circuit reads LOW when media is inserted and HIGH when empty. // Enable this option and set to HIGH if your SD cards are incorrectly detected. //#define SD_DETECT_STATE HIGH diff --git a/Marlin/src/inc/Conditionals-5-post.h b/Marlin/src/inc/Conditionals-5-post.h index 024eb42f51..b9eeb3d85a 100644 --- a/Marlin/src/inc/Conditionals-5-post.h +++ b/Marlin/src/inc/Conditionals-5-post.h @@ -605,11 +605,9 @@ #endif #endif - #if HAS_SD_DETECT && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI, HAS_DWIN_E3V2, HAS_U8GLIB_I2C_OLED) - #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion - #endif - -#endif // HAS_MEDIA +#else // !HAS_MEDIA + #undef REINIT_NOISY_LCD +#endif /** * Power Supply diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 9c4eabaf6e..1164fe1bb4 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -993,3 +993,12 @@ #if ALL(SMOOTH_LIN_ADVANCE, MIXING_EXTRUDER) #warning "SMOOTH_LIN_ADVANCE with MIXING_EXTRUDER is untested. Use with caution." #endif + +/** + * Some LCDs need re-init to deal with flaky SPI bus sharing + */ +#if HAS_SD_DETECT && NONE(REINIT_NOISY_LCD, HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI, HAS_DWIN_E3V2, HAS_U8GLIB_I2C_OLED) + #warning "It is recommended to enable REINIT_NOISY_LCD with your LCD controller model." +#elif ENABLED(REINIT_NOISY_LCD) + #warning "REINIT_NOISY_LCD is probably not required with your LCD controller model." +#endif