Browse Source

Boot-screen for the character displays

Uses about 488 byte of progmem and 32 byte of RAM.
For that configurable.
AnHardt 10 years ago
parent
commit
09571b7753
2 changed files with 86 additions and 0 deletions
  1. 1
    0
      Marlin/Configuration.h
  2. 85
    0
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 1
- 0
Marlin/Configuration.h View File

@@ -48,6 +48,7 @@ Here are some standard links for getting your machine calibrated:
48 48
 // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
49 49
 // build by the user have been successfully uploaded into firmware.
50 50
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
51
+#define SHOW_BOOTSCREEN
51 52
 #define STRING_SPLASH_LINE1 BUILD_VERSION // will be shown during bootup in line 1
52 53
 //#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
53 54
 

+ 85
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -193,6 +193,11 @@
193 193
 
194 194
 #include "utf_mapper.h"
195 195
 
196
+#if ENABLED(SHOW_BOOTSCREEN)
197
+  static void bootscreen();
198
+  static bool show_bootscreen = true;
199
+#endif
200
+
196 201
 #if ENABLED(LCD_PROGRESS_BAR)
197 202
   static millis_t progress_bar_ms = 0;
198 203
   #if PROGRESS_MSG_EXPIRE > 0
@@ -377,6 +382,10 @@ static void lcd_implementation_init(
377 382
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
378 383
   #endif
379 384
 
385
+  #if ENABLED(SHOW_BOOTSCREEN)
386
+    if (show_bootscreen) bootscreen();
387
+  #endif
388
+
380 389
   lcd_set_custom_characters(
381 390
     #if ENABLED(LCD_PROGRESS_BAR)
382 391
       progress_bar_set
@@ -404,6 +413,82 @@ char lcd_print(char* str) {
404 413
 
405 414
 unsigned lcd_print(char c) { return charset_mapper(c); }
406 415
 
416
+#if ENABLED(SHOW_BOOTSCREEN)
417
+  static void bootscreen() {
418
+    show_bootscreen = false;
419
+    byte top_left[8] = {
420
+      B00000,
421
+      B00000,
422
+      B00000,
423
+      B00000,
424
+      B00001,
425
+      B00010,
426
+      B00100,
427
+      B00100
428
+    };
429
+    byte top_right[8] = {
430
+      B00000,
431
+      B00000,
432
+      B00000,
433
+      B11100,
434
+      B11100,
435
+      B01100,
436
+      B00100,
437
+      B00100
438
+    };
439
+    byte botom_left[8] = {
440
+      B00100,
441
+      B00010,
442
+      B00001,
443
+      B00000,
444
+      B00000,
445
+      B00000,
446
+      B00000,
447
+      B00000
448
+    };
449
+    byte botom_right[8] = {
450
+      B00100,
451
+      B01000,
452
+      B10000,
453
+      B00000,
454
+      B00000,
455
+      B00000,
456
+      B00000,
457
+      B00000
458
+    };
459
+    lcd.createChar(0, top_left);
460
+    lcd.createChar(1, top_right);
461
+    lcd.createChar(2, botom_left);
462
+    lcd.createChar(3, botom_right);
463
+
464
+    lcd.clear();
465
+    //                                                         12345678901234567890
466
+    lcd.setCursor(0, 0); lcd.print('\x00'); lcd_printPGM(PSTR( "------"));  lcd.print('\x01');
467
+    lcd.setCursor(0, 1);                    lcd_printPGM(PSTR("|Marlin| "));
468
+    #if (LCD_WIDTH > 16) && defined(STRING_SPLASH_LINE1)
469
+       lcd_printPGM(PSTR(STRING_SPLASH_LINE1));
470
+    #endif
471
+    lcd.setCursor(0, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------"));  lcd.print('\x03');
472
+    lcd.setCursor(0, 3);                    lcd_printPGM(PSTR("marlinfirmware.org"));
473
+    delay(2000);
474
+
475
+    #if (LCD_WIDTH <= 16) && defined(STRING_SPLASH_LINE1)
476
+      lcd.setCursor(0, 3);
477
+      lcd_printPGM(PSTR("                  "));
478
+      lcd.setCursor(0, 3);
479
+      lcd_printPGM(PSTR(STRING_SPLASH_LINE1));
480
+      delay(1000);
481
+    #endif
482
+
483
+    #ifdef STRING_SPLASH_LINE2
484
+      lcd.setCursor(0, 3);
485
+      lcd_printPGM(PSTR("                  "));
486
+      lcd.setCursor(0, 3);
487
+      lcd_printPGM(PSTR(STRING_SPLASH_LINE2));
488
+      delay(1000);
489
+    #endif
490
+  }
491
+#endif // SHOW_BOOTSCREEN
407 492
 /*
408 493
 Possible status screens:
409 494
 16x2   |000/000 B000/000|

Loading…
Cancel
Save