Browse Source

always completely initialize display (#9981)

pull/1/head
Bob-the-Kuhn 7 years ago
committed by Scott Lahteine
parent
commit
04dedc7ed8
  1. 71
      Marlin/src/lcd/ultralcd_impl_HD44780.h

71
Marlin/src/lcd/ultralcd_impl_HD44780.h

@ -222,9 +222,11 @@ static void createChar_P(const char c, const byte * const ptr) {
lcd.createChar(c, temp); lcd.createChar(c, temp);
} }
#define CHARSET_MENU 0 enum HD44780CharSet : char {
#define CHARSET_INFO 1 CHARSET_MENU,
#define CHARSET_BOOT 2 CHARSET_INFO,
CHARSET_BOOT
};
static void lcd_set_custom_characters( static void lcd_set_custom_characters(
#if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN) #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
@ -399,49 +401,38 @@ static void lcd_set_custom_characters(
#endif // SDSUPPORT #endif // SDSUPPORT
#if ENABLED(SHOW_BOOTSCREEN) || ENABLED(LCD_PROGRESS_BAR) #if ENABLED(SHOW_BOOTSCREEN)
static uint8_t char_mode = CHARSET_MENU; // Set boot screen corner characters
#define CHAR_COND (screen_charset != char_mode) if (screen_charset == CHARSET_BOOT) {
#else for (uint8_t i = 4; i--;)
#define CHAR_COND true createChar_P(i, corner[i]);
}
else
#endif #endif
{ // Info Screen uses 5 special characters
if (CHAR_COND) { createChar_P(LCD_BEDTEMP_CHAR, bedTemp);
#if ENABLED(SHOW_BOOTSCREEN) || ENABLED(LCD_PROGRESS_BAR) createChar_P(LCD_DEGREE_CHAR, degree);
char_mode = screen_charset; createChar_P(LCD_STR_THERMOMETER[0], thermometer);
#if ENABLED(SHOW_BOOTSCREEN) createChar_P(LCD_FEEDRATE_CHAR, feedrate);
// Set boot screen corner characters createChar_P(LCD_CLOCK_CHAR, clock);
if (screen_charset == CHARSET_BOOT) {
for (uint8_t i = 4; i--;) #if ENABLED(LCD_PROGRESS_BAR)
createChar_P(i, corner[i]); if (screen_charset == CHARSET_INFO) { // 3 Progress bar characters for info screen
for (int16_t i = 3; i--;)
createChar_P(LCD_STR_PROGRESS[i], progress[i]);
} }
else else
#endif #endif
#endif {
{ // Info Screen uses 5 special characters createChar_P(LCD_UPLEVEL_CHAR, uplevel);
createChar_P(LCD_BEDTEMP_CHAR, bedTemp); #if ENABLED(SDSUPPORT)
createChar_P(LCD_DEGREE_CHAR, degree); // SD Card sub-menu special characters
createChar_P(LCD_STR_THERMOMETER[0], thermometer); createChar_P(LCD_STR_REFRESH[0], refresh);
createChar_P(LCD_FEEDRATE_CHAR, feedrate); createChar_P(LCD_STR_FOLDER[0], folder);
createChar_P(LCD_CLOCK_CHAR, clock);
#if ENABLED(LCD_PROGRESS_BAR)
if (screen_charset == CHARSET_INFO) { // 3 Progress bar characters for info screen
for (int16_t i = 3; i--;)
createChar_P(LCD_STR_PROGRESS[i], progress[i]);
}
else
#endif #endif
{
createChar_P(LCD_UPLEVEL_CHAR, uplevel);
#if ENABLED(SDSUPPORT)
// SD Card sub-menu special characters
createChar_P(LCD_STR_REFRESH[0], refresh);
createChar_P(LCD_STR_FOLDER[0], folder);
#endif
}
} }
} }
} }
static void lcd_implementation_init( static void lcd_implementation_init(

Loading…
Cancel
Save