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
   // loads data from EEPROM if available else uses defaults (and resets step acceleration rate)
857
   // loads data from EEPROM if available else uses defaults (and resets step acceleration rate)
858
   Config_RetrieveSettings();
858
   Config_RetrieveSettings();
859
 
859
 
860
-  lcd_init();
861
-
862
   thermalManager.init();    // Initialize temperature loop
860
   thermalManager.init();    // Initialize temperature loop
863
 
861
 
864
   #if ENABLED(DELTA) || ENABLED(SCARA)
862
   #if ENABLED(DELTA) || ENABLED(SCARA)
906
     pinMode(STAT_LED_BLUE, OUTPUT);
904
     pinMode(STAT_LED_BLUE, OUTPUT);
907
     digitalWrite(STAT_LED_BLUE, LOW); // turn it off
905
     digitalWrite(STAT_LED_BLUE, LOW); // turn it off
908
   #endif
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
 
8293
 
8284
 void kill(const char* lcd_msg) {
8294
 void kill(const char* lcd_msg) {
8285
   #if ENABLED(ULTRA_LCD)
8295
   #if ENABLED(ULTRA_LCD)
8296
+    lcd_init();
8286
     lcd_setalertstatuspgm(lcd_msg);
8297
     lcd_setalertstatuspgm(lcd_msg);
8287
   #else
8298
   #else
8288
     UNUSED(lcd_msg);
8299
     UNUSED(lcd_msg);

+ 2
- 4
Marlin/dogm_lcd_implementation.h View File

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

+ 3
- 0
Marlin/ultralcd.h View File

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

+ 1
- 11
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

201
 
201
 
202
 #include "utf_mapper.h"
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
 #if ENABLED(LCD_PROGRESS_BAR)
204
 #if ENABLED(LCD_PROGRESS_BAR)
210
   static millis_t progress_bar_ms = 0;
205
   static millis_t progress_bar_ms = 0;
211
   #if PROGRESS_MSG_EXPIRE > 0
206
   #if PROGRESS_MSG_EXPIRE > 0
394
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
389
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
395
   #endif
390
   #endif
396
 
391
 
397
-  #if ENABLED(SHOW_BOOTSCREEN)
398
-    if (show_bootscreen) bootscreen();
399
-  #endif
400
-
401
   lcd_set_custom_characters(
392
   lcd_set_custom_characters(
402
     #if ENABLED(LCD_PROGRESS_BAR)
393
     #if ENABLED(LCD_PROGRESS_BAR)
403
       progress_bar_set
394
       progress_bar_set
452
     lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" ));  lcd.print('\x03');
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
     byte top_left[8] = {
447
     byte top_left[8] = {
458
       B00000,
448
       B00000,
459
       B00000,
449
       B00000,

Loading…
Cancel
Save