From 65ce0303f88ecb42a7503023e73222d67aeb1d28 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 13 Mar 2018 04:54:23 -0500 Subject: [PATCH] Fix MKS_12864_OLED blank issue Fixes #10071 --- Marlin/src/lcd/ultralcd_impl_DOGM.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/ultralcd_impl_DOGM.h b/Marlin/src/lcd/ultralcd_impl_DOGM.h index 6d4910a1f..84c937968 100644 --- a/Marlin/src/lcd/ultralcd_impl_DOGM.h +++ b/Marlin/src/lcd/ultralcd_impl_DOGM.h @@ -364,23 +364,26 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { // Initialize or re-initialize the LCD static void lcd_implementation_init() { + #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight + OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); + #endif + #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) SET_OUTPUT(LCD_PINS_DC); OUT_WRITE(LCD_PINS_RS, LOW); - delay(1000); + _delay_ms(500); WRITE(LCD_PINS_RS, HIGH); #endif - #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight - OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); - #endif - #if PIN_EXISTS(LCD_RESET) OUT_WRITE(LCD_RESET_PIN, LOW); // perform a clean hardware reset _delay_ms(5); OUT_WRITE(LCD_RESET_PIN, HIGH); _delay_ms(5); // delay to allow the display to initalize - u8g.begin(); // re-initialize the display + #endif + + #if PIN_EXISTS(LCD_RESET) || ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) + u8g.begin(); #endif #if DISABLED(MINIPANEL) // setContrast not working for Mini Panel