Make bootscreen configurable for the graphic displays

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

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

@ -3,6 +3,7 @@
// Please note that using the high-res version takes 402Bytes of PROGMEM. // Please note that using the high-res version takes 402Bytes of PROGMEM.
//#define START_BMPHIGH //#define START_BMPHIGH
#if ENABLED(SHOW_BOOTSCREEN)
#if ENABLED(START_BMPHIGH) #if ENABLED(START_BMPHIGH)
#define START_BMPWIDTH 112 #define START_BMPWIDTH 112
#define START_BMPHEIGHT 38 #define START_BMPHEIGHT 38
@ -75,6 +76,7 @@
,0x60,0x00,0x00,0x00,0x00,0x00,0x06 ,0x60,0x00,0x00,0x00,0x00,0x00,0x06
,0x1f,0xff,0xff,0xff,0xff,0xff,0xf8 }; ,0x1f,0xff,0xff,0xff,0xff,0xff,0xf8 };
#endif #endif
#endif
// Here comes a compile-time operation to match the extruder symbols // Here comes a compile-time operation to match the extruder symbols
// on the info screen to the set number of extruders in configuration.h // on the info screen to the set number of extruders in configuration.h

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

Loading…
Cancel
Save