Add MKS Robin Pro, MKS Robin Lite3 (#16163)

This commit is contained in:
MS1987
2019-12-11 14:23:47 +08:00
committed by Scott Lahteine
parent 1c48817a47
commit 31fdaea269
19 changed files with 5075 additions and 59 deletions

View File

@ -244,48 +244,51 @@ bool MarlinUI::detected() { return true; }
// Initialize or re-initialize the LCD
void MarlinUI::init_lcd() {
#if DISABLED(MKS_LCD12864B)
#if PIN_EXISTS(LCD_BACKLIGHT)
OUT_WRITE(LCD_BACKLIGHT_PIN, (
#if ENABLED(DELAYED_BACKLIGHT_INIT)
LOW // Illuminate after reset
#else
HIGH // Illuminate right away
#endif
));
#endif
#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
SET_OUTPUT(LCD_PINS_DC);
#ifndef LCD_RESET_PIN
#define LCD_RESET_PIN LCD_PINS_RS
#if PIN_EXISTS(LCD_BACKLIGHT)
OUT_WRITE(LCD_BACKLIGHT_PIN, (
#if ENABLED(DELAYED_BACKLIGHT_INIT)
LOW // Illuminate after reset
#else
HIGH // Illuminate right away
#endif
));
#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
#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
SET_OUTPUT(LCD_PINS_DC);
#ifndef LCD_RESET_PIN
#define LCD_RESET_PIN LCD_PINS_RS
#endif
#endif
#if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
WRITE(LCD_BACKLIGHT_PIN, HIGH);
#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
#if HAS_LCD_CONTRAST
refresh_contrast();
#endif
#if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
WRITE(LCD_BACKLIGHT_PIN, HIGH);
#endif
#if ENABLED(LCD_SCREEN_ROT_90)
u8g.setRot90();
#elif ENABLED(LCD_SCREEN_ROT_180)
u8g.setRot180();
#elif ENABLED(LCD_SCREEN_ROT_270)
u8g.setRot270();
#endif
#if HAS_LCD_CONTRAST
refresh_contrast();
#endif
#if ENABLED(LCD_SCREEN_ROT_90)
u8g.setRot90();
#elif ENABLED(LCD_SCREEN_ROT_180)
u8g.setRot180();
#elif ENABLED(LCD_SCREEN_ROT_270)
u8g.setRot270();
#endif
#endif // !MKS_LCD12864B
uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo));
}