Browse Source

Disable splash-screen when done once

Splash screen was shown with every display init.
That means every time the menus where entered.

Note the 2 in the initialisation.
The buffer is already written in two steps a 512 byte.
Without the 2 only the upper half is shown.
pull/1/head
AnHardt 10 years ago
parent
commit
9865318f1c
  1. 23
      Marlin/dogm_lcd_implementation.h

23
Marlin/dogm_lcd_implementation.h

@ -186,6 +186,8 @@ char lcd_printPGM(const char* str) {
return n; return n;
} }
static int8_t show_splashscreed = 2;
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,15 +221,18 @@ static void lcd_implementation_init()
u8g.firstPage(); u8g.firstPage();
do { do {
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); if (show_splashscreed) {
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
show_splashscreed--;
}
} while (u8g.nextPage()); } while (u8g.nextPage());
} }

Loading…
Cancel
Save