Merge pull request #1823 from AnHardt/splashscreen
Disable splash-screen when done once
This commit is contained in:
commit
d70a4a3847
1 changed files with 14 additions and 9 deletions
|
@ -186,6 +186,8 @@ char lcd_printPGM(const char* str) {
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool show_splashscreen = true;
|
||||||
|
|
||||||
static void lcd_implementation_init()
|
static void lcd_implementation_init()
|
||||||
{
|
{
|
||||||
#ifdef LCD_PIN_BL // Enable LCD backlight
|
#ifdef LCD_PIN_BL // Enable LCD backlight
|
||||||
|
@ -219,16 +221,19 @@ static void lcd_implementation_init()
|
||||||
|
|
||||||
u8g.firstPage();
|
u8g.firstPage();
|
||||||
do {
|
do {
|
||||||
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
|
if (show_splashscreen) {
|
||||||
lcd_setFont(FONT_MENU);
|
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
|
||||||
#ifndef STRING_SPLASH_LINE2
|
lcd_setFont(FONT_MENU);
|
||||||
u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1);
|
#ifndef STRING_SPLASH_LINE2
|
||||||
#else
|
u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1);
|
||||||
int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2;
|
#else
|
||||||
u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1);
|
int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2;
|
||||||
u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2);
|
u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1);
|
||||||
#endif
|
u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
} while (u8g.nextPage());
|
} while (u8g.nextPage());
|
||||||
|
show_splashscreen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
|
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
|
||||||
|
|
Reference in a new issue