Make bootscreen configurable for the graphic displays

Saves about 473 byte of progmem and 28 bytes of RAM.
2.0.x
AnHardt 9 years ago committed by Richard Wackerbarth
parent 09571b7753
commit 4f46df5dab

@ -666,7 +666,6 @@ void setup() {
Config_RetrieveSettings();
lcd_init();
_delay_ms(1000); // wait 1sec to display the splash screen
tp_init(); // Initialize temperature loop
plan_init(); // Initialize planner;

@ -3,7 +3,8 @@
// Please note that using the high-res version takes 402Bytes of PROGMEM.
//#define START_BMPHIGH
#if ENABLED(START_BMPHIGH)
#if ENABLED(SHOW_BOOTSCREEN)
#if ENABLED(START_BMPHIGH)
#define START_BMPWIDTH 112
#define START_BMPHEIGHT 38
#define START_BMPBYTEWIDTH 14
@ -48,7 +49,7 @@
,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78
,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0
,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80 };
#else
#else
#define START_BMPWIDTH 56
#define START_BMPHEIGHT 19
#define START_BMPBYTEWIDTH 7
@ -74,6 +75,7 @@
,0x40,0x00,0x00,0x00,0x00,0x00,0x02
,0x60,0x00,0x00,0x00,0x00,0x00,0x06
,0x1f,0xff,0xff,0xff,0xff,0xff,0xf8 };
#endif
#endif
// Here comes a compile-time operation to match the extruder symbols

@ -190,7 +190,9 @@ char lcd_printPGM(const char* str) {
return n;
}
static bool show_splashscreen = true;
#if ENABLED(SHOW_BOOTSCREEN)
static bool show_bootscreen = true;
#endif
/* Warning: This function is called from interrupt context */
static void lcd_implementation_init() {
@ -220,7 +222,7 @@ static void lcd_implementation_init() {
u8g.setRot270(); // Rotate screen by 270°
#endif
// Show splashscreen
#if ENABLED(SHOW_BOOTSCREEN)
int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
#if ENABLED(START_BMPHIGH)
int offy = 0;
@ -232,7 +234,7 @@ static void lcd_implementation_init() {
u8g.firstPage();
do {
if (show_splashscreen) {
if (show_bootscreen) {
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
lcd_setFont(FONT_MENU);
#ifndef STRING_SPLASH_LINE2
@ -244,7 +246,12 @@ static void lcd_implementation_init() {
#endif
}
} while (u8g.nextPage());
show_splashscreen = false;
if (show_bootscreen) {
delay(1000);
show_bootscreen = false;
}
#endif
}
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop

Loading…
Cancel
Save