From 45c74406cf8eb4a294c1c2690aa50706cdf1b784 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 5 Jun 2017 17:45:28 -0500 Subject: [PATCH] Recover 32 bytes of SRAM in Marlin bootscreen code --- Marlin/ultralcd_impl_HD44780.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index ed7d630b4..e281cacaa 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -440,7 +440,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { } void bootscreen() { - byte top_left[8] = { + const static PROGMEM byte corner[4][8] = { { B00000, B00000, B00000, @@ -449,8 +449,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { B00010, B00100, B00100 - }; - byte top_right[8] = { + }, { B00000, B00000, B00000, @@ -459,8 +458,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { B01100, B00100, B00100 - }; - byte botom_left[8] = { + }, { B00100, B00010, B00001, @@ -469,8 +467,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { B00000, B00000, B00000 - }; - byte botom_right[8] = { + }, { B00100, B01000, B10000, @@ -479,11 +476,9 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { B00000, B00000, B00000 - }; - lcd.createChar(0, top_left); - lcd.createChar(1, top_right); - lcd.createChar(2, botom_left); - lcd.createChar(3, botom_right); + } }; + for (uint8_t i = 0; i < 4; i++) + createChar_P(i, corner[i]); lcd.clear();