Browse Source

Fix MKS_12864_OLED blank issue

Fixes #10071
Scott Lahteine 7 years ago
parent
commit
65ce0303f8
1 changed files with 9 additions and 6 deletions
  1. 9
    6
      Marlin/src/lcd/ultralcd_impl_DOGM.h

+ 9
- 6
Marlin/src/lcd/ultralcd_impl_DOGM.h View File

364
 // Initialize or re-initialize the LCD
364
 // Initialize or re-initialize the LCD
365
 static void lcd_implementation_init() {
365
 static void lcd_implementation_init() {
366
 
366
 
367
+  #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight
368
+    OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH);
369
+  #endif
370
+
367
   #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
371
   #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
368
     SET_OUTPUT(LCD_PINS_DC);
372
     SET_OUTPUT(LCD_PINS_DC);
369
     OUT_WRITE(LCD_PINS_RS, LOW);
373
     OUT_WRITE(LCD_PINS_RS, LOW);
370
-    delay(1000);
374
+    _delay_ms(500);
371
     WRITE(LCD_PINS_RS, HIGH);
375
     WRITE(LCD_PINS_RS, HIGH);
372
   #endif
376
   #endif
373
 
377
 
374
-  #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight
375
-    OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH);
376
-  #endif
377
-
378
   #if PIN_EXISTS(LCD_RESET)
378
   #if PIN_EXISTS(LCD_RESET)
379
     OUT_WRITE(LCD_RESET_PIN, LOW); // perform a clean hardware reset
379
     OUT_WRITE(LCD_RESET_PIN, LOW); // perform a clean hardware reset
380
     _delay_ms(5);
380
     _delay_ms(5);
381
     OUT_WRITE(LCD_RESET_PIN, HIGH);
381
     OUT_WRITE(LCD_RESET_PIN, HIGH);
382
     _delay_ms(5); // delay to allow the display to initalize
382
     _delay_ms(5); // delay to allow the display to initalize
383
-    u8g.begin(); // re-initialize the display
383
+  #endif
384
+
385
+  #if PIN_EXISTS(LCD_RESET) || ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
386
+    u8g.begin();
384
   #endif
387
   #endif
385
 
388
 
386
   #if DISABLED(MINIPANEL) // setContrast not working for Mini Panel
389
   #if DISABLED(MINIPANEL) // setContrast not working for Mini Panel

Loading…
Cancel
Save