|
@@ -240,39 +240,35 @@ bool MarlinUI::detected() { return true; }
|
240
|
240
|
|
241
|
241
|
// Initialize or re-initialize the LCD
|
242
|
242
|
void MarlinUI::init_lcd() {
|
243
|
|
- #if DISABLED(MKS_LCD12864)
|
244
|
|
-
|
245
|
|
- #if PIN_EXISTS(LCD_BACKLIGHT)
|
246
|
|
- OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
|
247
|
|
- #endif
|
248
|
|
-
|
249
|
|
- #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864, ZONESTAR_12864OLED)
|
250
|
|
- SET_OUTPUT(LCD_PINS_DC);
|
251
|
|
- #ifndef LCD_RESET_PIN
|
252
|
|
- #define LCD_RESET_PIN LCD_PINS_RS
|
253
|
|
- #endif
|
254
|
|
- #endif
|
255
|
|
-
|
256
|
|
- #if PIN_EXISTS(LCD_RESET)
|
257
|
|
- // Perform a clean hardware reset with needed delays
|
258
|
|
- OUT_WRITE(LCD_RESET_PIN, LOW);
|
259
|
|
- _delay_ms(5);
|
260
|
|
- WRITE(LCD_RESET_PIN, HIGH);
|
261
|
|
- _delay_ms(5);
|
262
|
|
- u8g.begin();
|
|
243
|
+ #if PIN_EXISTS(LCD_BACKLIGHT)
|
|
244
|
+ OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
|
|
245
|
+ #endif
|
|
246
|
+
|
|
247
|
+ #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864, ZONESTAR_12864OLED)
|
|
248
|
+ SET_OUTPUT(LCD_PINS_DC);
|
|
249
|
+ #ifndef LCD_RESET_PIN
|
|
250
|
+ #define LCD_RESET_PIN LCD_PINS_RS
|
263
|
251
|
#endif
|
264
|
|
-
|
265
|
|
- #if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
|
266
|
|
- WRITE(LCD_BACKLIGHT_PIN, HIGH);
|
267
|
|
- #endif
|
268
|
|
-
|
269
|
|
- TERN_(HAS_LCD_CONTRAST, refresh_contrast());
|
270
|
|
-
|
271
|
|
- TERN_(LCD_SCREEN_ROT_90, u8g.setRot90());
|
272
|
|
- TERN_(LCD_SCREEN_ROT_180, u8g.setRot180());
|
273
|
|
- TERN_(LCD_SCREEN_ROT_270, u8g.setRot270());
|
274
|
|
-
|
275
|
|
- #endif // !MKS_LCD12864
|
|
252
|
+ #endif
|
|
253
|
+
|
|
254
|
+ #if PIN_EXISTS(LCD_RESET)
|
|
255
|
+ // Perform a clean hardware reset with needed delays
|
|
256
|
+ OUT_WRITE(LCD_RESET_PIN, LOW);
|
|
257
|
+ _delay_ms(5);
|
|
258
|
+ WRITE(LCD_RESET_PIN, HIGH);
|
|
259
|
+ _delay_ms(5);
|
|
260
|
+ u8g.begin();
|
|
261
|
+ #endif
|
|
262
|
+
|
|
263
|
+ #if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
|
|
264
|
+ WRITE(LCD_BACKLIGHT_PIN, HIGH);
|
|
265
|
+ #endif
|
|
266
|
+
|
|
267
|
+ TERN_(HAS_LCD_CONTRAST, refresh_contrast());
|
|
268
|
+
|
|
269
|
+ TERN_(LCD_SCREEN_ROT_90, u8g.setRot90());
|
|
270
|
+ TERN_(LCD_SCREEN_ROT_180, u8g.setRot180());
|
|
271
|
+ TERN_(LCD_SCREEN_ROT_270, u8g.setRot270());
|
276
|
272
|
|
277
|
273
|
uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo));
|
278
|
274
|
}
|