Make bootscreen configurable for the graphic displays

Saves about 473 byte of progmem and 28 bytes of RAM.
This commit is contained in:
AnHardt 2015-07-31 19:32:23 +02:00 committed by Richard Wackerbarth
parent 09571b7753
commit 4f46df5dab
3 changed files with 108 additions and 100 deletions

View File

@ -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;

View File

@ -3,7 +3,8 @@
// 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(START_BMPHIGH) #if ENABLED(SHOW_BOOTSCREEN)
#if ENABLED(START_BMPHIGH)
#define START_BMPWIDTH 112 #define START_BMPWIDTH 112
#define START_BMPHEIGHT 38 #define START_BMPHEIGHT 38
#define START_BMPBYTEWIDTH 14 #define START_BMPBYTEWIDTH 14
@ -48,7 +49,7 @@
,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78 ,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 ,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 }; ,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80 };
#else #else
#define START_BMPWIDTH 56 #define START_BMPWIDTH 56
#define START_BMPHEIGHT 19 #define START_BMPHEIGHT 19
#define START_BMPBYTEWIDTH 7 #define START_BMPBYTEWIDTH 7
@ -74,6 +75,7 @@
,0x40,0x00,0x00,0x00,0x00,0x00,0x02 ,0x40,0x00,0x00,0x00,0x00,0x00,0x02
,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

View File

@ -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