Browse Source

Show bootscreen later

Init display and show bootscreen later, but init display in `kill()`
to init outputs before the bootscreen delays but being able to display
kill errors.
AnHardt 8 years ago
parent
commit
b4fedec0d1

+ 13
- 2
Marlin/Marlin_main.cpp View File

@@ -857,8 +857,6 @@ void setup() {
857 857
   // loads data from EEPROM if available else uses defaults (and resets step acceleration rate)
858 858
   Config_RetrieveSettings();
859 859
 
860
-  lcd_init();
861
-
862 860
   thermalManager.init();    // Initialize temperature loop
863 861
 
864 862
   #if ENABLED(DELTA) || ENABLED(SCARA)
@@ -906,6 +904,18 @@ void setup() {
906 904
     pinMode(STAT_LED_BLUE, OUTPUT);
907 905
     digitalWrite(STAT_LED_BLUE, LOW); // turn it off
908 906
   #endif
907
+
908
+  lcd_init();
909
+  #if ENABLED(SHOW_BOOTSCREEN)
910
+    #if ENABLED(DOGLCD)
911
+      delay(1000);
912
+    #elif ENABLED(ULTRA_LCD)
913
+      bootscreen();
914
+      lcd_init();
915
+    #endif
916
+  #endif
917
+
918
+
909 919
 }
910 920
 
911 921
 /**
@@ -8283,6 +8293,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
8283 8293
 
8284 8294
 void kill(const char* lcd_msg) {
8285 8295
   #if ENABLED(ULTRA_LCD)
8296
+    lcd_init();
8286 8297
     lcd_setalertstatuspgm(lcd_msg);
8287 8298
   #else
8288 8299
     UNUSED(lcd_msg);

+ 2
- 4
Marlin/dogm_lcd_implementation.h View File

@@ -271,10 +271,8 @@ static void lcd_implementation_init() {
271 271
       }
272 272
     } while (u8g.nextPage());
273 273
 
274
-    if (show_bootscreen) {
275
-      delay(1000);
276
-      show_bootscreen = false;
277
-    }
274
+    show_bootscreen = false;
275
+
278 276
   #endif
279 277
 }
280 278
 

+ 3
- 0
Marlin/ultralcd.h View File

@@ -52,8 +52,11 @@
52 52
   #if ENABLED(DOGLCD)
53 53
     extern int lcd_contrast;
54 54
     void set_lcd_contrast(int value);
55
+  #elif ENABLED(SHOW_BOOTSCREEN)
56
+    void bootscreen();
55 57
   #endif
56 58
 
59
+
57 60
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
58 61
   #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
59 62
 

+ 1
- 11
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -201,11 +201,6 @@ extern volatile uint8_t buttons;  //an extended version of the last checked butt
201 201
 
202 202
 #include "utf_mapper.h"
203 203
 
204
-#if ENABLED(SHOW_BOOTSCREEN)
205
-  static void bootscreen();
206
-  static bool show_bootscreen = true;
207
-#endif
208
-
209 204
 #if ENABLED(LCD_PROGRESS_BAR)
210 205
   static millis_t progress_bar_ms = 0;
211 206
   #if PROGRESS_MSG_EXPIRE > 0
@@ -394,10 +389,6 @@ static void lcd_implementation_init(
394 389
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
395 390
   #endif
396 391
 
397
-  #if ENABLED(SHOW_BOOTSCREEN)
398
-    if (show_bootscreen) bootscreen();
399
-  #endif
400
-
401 392
   lcd_set_custom_characters(
402 393
     #if ENABLED(LCD_PROGRESS_BAR)
403 394
       progress_bar_set
@@ -452,8 +443,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
452 443
     lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" ));  lcd.print('\x03');
453 444
   }
454 445
 
455
-  static void bootscreen() {
456
-    show_bootscreen = false;
446
+  void bootscreen() {
457 447
     byte top_left[8] = {
458 448
       B00000,
459 449
       B00000,

Loading…
Cancel
Save