|
@ -240,39 +240,35 @@ bool MarlinUI::detected() { return true; } |
|
|
|
|
|
|
|
|
// Initialize or re-initialize the LCD
|
|
|
// Initialize or re-initialize the LCD
|
|
|
void MarlinUI::init_lcd() { |
|
|
void MarlinUI::init_lcd() { |
|
|
#if DISABLED(MKS_LCD12864) |
|
|
#if PIN_EXISTS(LCD_BACKLIGHT) |
|
|
|
|
|
OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
|
|
|
#if PIN_EXISTS(LCD_BACKLIGHT) |
|
|
#endif |
|
|
OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
|
|
|
|
|
|
#endif |
|
|
#if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864, ZONESTAR_12864OLED) |
|
|
|
|
|
SET_OUTPUT(LCD_PINS_DC); |
|
|
#if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864, ZONESTAR_12864OLED) |
|
|
#ifndef LCD_RESET_PIN |
|
|
SET_OUTPUT(LCD_PINS_DC); |
|
|
#define LCD_RESET_PIN LCD_PINS_RS |
|
|
#ifndef LCD_RESET_PIN |
|
|
|
|
|
#define LCD_RESET_PIN LCD_PINS_RS |
|
|
|
|
|
#endif |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if PIN_EXISTS(LCD_RESET) |
|
|
|
|
|
// Perform a clean hardware reset with needed delays
|
|
|
|
|
|
OUT_WRITE(LCD_RESET_PIN, LOW); |
|
|
|
|
|
_delay_ms(5); |
|
|
|
|
|
WRITE(LCD_RESET_PIN, HIGH); |
|
|
|
|
|
_delay_ms(5); |
|
|
|
|
|
u8g.begin(); |
|
|
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#endif |
|
|
#if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT) |
|
|
|
|
|
WRITE(LCD_BACKLIGHT_PIN, HIGH); |
|
|
#if PIN_EXISTS(LCD_RESET) |
|
|
#endif |
|
|
// Perform a clean hardware reset with needed delays
|
|
|
|
|
|
OUT_WRITE(LCD_RESET_PIN, LOW); |
|
|
TERN_(HAS_LCD_CONTRAST, refresh_contrast()); |
|
|
_delay_ms(5); |
|
|
|
|
|
WRITE(LCD_RESET_PIN, HIGH); |
|
|
TERN_(LCD_SCREEN_ROT_90, u8g.setRot90()); |
|
|
_delay_ms(5); |
|
|
TERN_(LCD_SCREEN_ROT_180, u8g.setRot180()); |
|
|
u8g.begin(); |
|
|
TERN_(LCD_SCREEN_ROT_270, u8g.setRot270()); |
|
|
#endif |
|
|
|
|
|
|
|
|
#endif // !MKS_LCD12864
|
|
|
#if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT) |
|
|
|
|
|
WRITE(LCD_BACKLIGHT_PIN, HIGH); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
TERN_(HAS_LCD_CONTRAST, refresh_contrast()); |
|
|
|
|
|
|
|
|
|
|
|
TERN_(LCD_SCREEN_ROT_90, u8g.setRot90()); |
|
|
|
|
|
TERN_(LCD_SCREEN_ROT_180, u8g.setRot180()); |
|
|
|
|
|
TERN_(LCD_SCREEN_ROT_270, u8g.setRot270()); |
|
|
|
|
|
|
|
|
uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo)); |
|
|
uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo)); |
|
|
} |
|
|
} |
|
|