From 121931062219467cada6ed2470644b799ff7db2d Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 15 Jun 2016 18:11:55 +0200 Subject: [PATCH] Introduce save_delay() Introduce save_delay() for long delays what otherwise would cause watchdog resets Explizit lcd_set_custom_characters(false) at the end of bootscreen(). Else the charset is not proper set in case of LCD_PROGRESS_BAR. --- .../ultralcd_implementation_hitachi_HD44780.h | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 9ca75731c..24b68830d 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -443,6 +443,15 @@ unsigned lcd_print(char c) { return charset_mapper(c); } lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" )); lcd.print('\x03'); } + void safe_delay(uint16_t del){ + while (del > 50) { + del -= 50; + delay(50); + thermalManager.manage_heater(); + } + delay(del); + } + void bootscreen() { byte top_left[8] = { B00000, @@ -498,7 +507,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); } if (strlen(STRING) <= LCD_WIDTH) { \ lcd.setCursor((LCD_WIDTH - lcd_strlen_P(PSTR(STRING))) / 2, 3); \ lcd_printPGM(PSTR(STRING)); \ - delay(DELAY); \ + safe_delay(DELAY); \ } \ else { \ lcd_scroll(0, 3, PSTR(STRING), LCD_WIDTH, DELAY); \ @@ -516,7 +525,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); } #ifdef STRING_SPLASH_LINE2 CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000); #else - delay(2000); + safe_delay(2000); #endif } else { @@ -541,7 +550,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); } // if (LCD_EXTRA_SPACE >= strlen(STRING_SPLASH_LINE2) + 1) { logo_lines(PSTR(" " STRING_SPLASH_LINE2)); - delay(2000); + safe_delay(2000); } else { logo_lines(PSTR("")); @@ -552,9 +561,13 @@ unsigned lcd_print(char c) { return charset_mapper(c); } // Show only the Marlin logo // logo_lines(PSTR("")); - delay(2000); + safe_delay(2000); #endif - + lcd_set_custom_characters( + #if ENABLED(LCD_PROGRESS_BAR) + false + #endif + ); } #endif // SHOW_BOOTSCREEN