Browse Source

Recover 32 bytes of SRAM in Marlin bootscreen code

Scott Lahteine 8 years ago
parent
commit
45c74406cf
1 changed files with 7 additions and 12 deletions
  1. 7
    12
      Marlin/ultralcd_impl_HD44780.h

+ 7
- 12
Marlin/ultralcd_impl_HD44780.h View File

@@ -440,7 +440,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
440 440
   }
441 441
 
442 442
   void bootscreen() {
443
-    byte top_left[8] = {
443
+    const static PROGMEM byte corner[4][8] = { {
444 444
       B00000,
445 445
       B00000,
446 446
       B00000,
@@ -449,8 +449,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
449 449
       B00010,
450 450
       B00100,
451 451
       B00100
452
-    };
453
-    byte top_right[8] = {
452
+    }, {
454 453
       B00000,
455 454
       B00000,
456 455
       B00000,
@@ -459,8 +458,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
459 458
       B01100,
460 459
       B00100,
461 460
       B00100
462
-    };
463
-    byte botom_left[8] = {
461
+    }, {
464 462
       B00100,
465 463
       B00010,
466 464
       B00001,
@@ -469,8 +467,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
469 467
       B00000,
470 468
       B00000,
471 469
       B00000
472
-    };
473
-    byte botom_right[8] = {
470
+    }, {
474 471
       B00100,
475 472
       B01000,
476 473
       B10000,
@@ -479,11 +476,9 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
479 476
       B00000,
480 477
       B00000,
481 478
       B00000
482
-    };
483
-    lcd.createChar(0, top_left);
484
-    lcd.createChar(1, top_right);
485
-    lcd.createChar(2, botom_left);
486
-    lcd.createChar(3, botom_right);
479
+    } };
480
+    for (uint8_t i = 0; i < 4; i++)
481
+      createChar_P(i, corner[i]);
487 482
 
488 483
     lcd.clear();
489 484
 

Loading…
Cancel
Save