Delay U8glib init using U8glib-HAL 0.4.4 (#21496)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Victor Oliveira
2021-04-08 22:35:21 -03:00
committed by GitHub
parent ecd5ae890f
commit 7124326808
3 changed files with 59 additions and 38 deletions

View File

@@ -76,7 +76,7 @@
#define FONT_STATUSMENU_NAME MENU_FONT_NAME
#endif
U8G_CLASS u8g(U8G_PARAM);
U8G_CLASS u8g;
#include LANGUAGE_DATA_INCL(LCD_LANGUAGE)
@@ -252,6 +252,13 @@ bool MarlinUI::detected() { return true; }
// Initialize or re-initialize the LCD
void MarlinUI::init_lcd() {
static bool did_init_u8g = false;
if (!did_init_u8g) {
u8g.init(U8G_PARAM);
did_init_u8g = true;
}
#if PIN_EXISTS(LCD_BACKLIGHT)
OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
#endif