|
|
@ -218,11 +218,57 @@ static void createChar_P(const char c, const byte * const ptr) {
|
|
|
|
lcd.createChar(c, temp);
|
|
|
|
lcd.createChar(c, temp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CHARSET_MENU 0
|
|
|
|
|
|
|
|
#define CHARSET_INFO 1
|
|
|
|
|
|
|
|
#define CHARSET_BOOT 2
|
|
|
|
|
|
|
|
|
|
|
|
static void lcd_set_custom_characters(
|
|
|
|
static void lcd_set_custom_characters(
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
|
|
|
|
const bool info_screen_charset = true
|
|
|
|
const uint8_t screen_charset=CHARSET_INFO
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
// CHARSET_BOOT
|
|
|
|
|
|
|
|
#if ENABLED(SHOW_BOOTSCREEN)
|
|
|
|
|
|
|
|
const static PROGMEM byte corner[4][8] = { {
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00001,
|
|
|
|
|
|
|
|
B00010,
|
|
|
|
|
|
|
|
B00100,
|
|
|
|
|
|
|
|
B00100
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B11100,
|
|
|
|
|
|
|
|
B11100,
|
|
|
|
|
|
|
|
B01100,
|
|
|
|
|
|
|
|
B00100,
|
|
|
|
|
|
|
|
B00100
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
B00100,
|
|
|
|
|
|
|
|
B00010,
|
|
|
|
|
|
|
|
B00001,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
B00100,
|
|
|
|
|
|
|
|
B01000,
|
|
|
|
|
|
|
|
B10000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000
|
|
|
|
|
|
|
|
} };
|
|
|
|
|
|
|
|
#endif // SHOW_BOOTSCREEN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CHARSET_INFO
|
|
|
|
const static PROGMEM byte bedTemp[8] = {
|
|
|
|
const static PROGMEM byte bedTemp[8] = {
|
|
|
|
B00000,
|
|
|
|
B00000,
|
|
|
|
B11111,
|
|
|
|
B11111,
|
|
|
@ -290,6 +336,8 @@ static void lcd_set_custom_characters(
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CHARSET_MENU
|
|
|
|
const static PROGMEM byte refresh[8] = {
|
|
|
|
const static PROGMEM byte refresh[8] = {
|
|
|
|
B00000,
|
|
|
|
B00000,
|
|
|
|
B00110,
|
|
|
|
B00110,
|
|
|
@ -312,6 +360,8 @@ static void lcd_set_custom_characters(
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CHARSET_INFO
|
|
|
|
const static PROGMEM byte progress[3][8] = { {
|
|
|
|
const static PROGMEM byte progress[3][8] = { {
|
|
|
|
B00000,
|
|
|
|
B00000,
|
|
|
|
B10000,
|
|
|
|
B10000,
|
|
|
@ -340,9 +390,31 @@ static void lcd_set_custom_characters(
|
|
|
|
B10101,
|
|
|
|
B10101,
|
|
|
|
B00000
|
|
|
|
B00000
|
|
|
|
} };
|
|
|
|
} };
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#endif // LCD_PROGRESS_BAR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SDSUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SHOW_BOOTSCREEN) || ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
|
|
|
|
static uint8_t char_mode = 0;
|
|
|
|
|
|
|
|
#define CHAR_COND (screen_charset != char_mode)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define CHAR_COND true
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CHAR_COND) {
|
|
|
|
|
|
|
|
#if ENABLED(SHOW_BOOTSCREEN) || ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
|
|
|
|
char_mode = screen_charset;
|
|
|
|
|
|
|
|
#if ENABLED(SHOW_BOOTSCREEN)
|
|
|
|
|
|
|
|
// Set boot screen corner characters
|
|
|
|
|
|
|
|
if (screen_charset == CHARSET_BOOT) {
|
|
|
|
|
|
|
|
for (uint8_t i = 4; i--;)
|
|
|
|
|
|
|
|
createChar_P(i, corner[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
{ // Info Screen uses 5 special characters
|
|
|
|
createChar_P(LCD_BEDTEMP_CHAR, bedTemp);
|
|
|
|
createChar_P(LCD_BEDTEMP_CHAR, bedTemp);
|
|
|
|
createChar_P(LCD_DEGREE_CHAR, degree);
|
|
|
|
createChar_P(LCD_DEGREE_CHAR, degree);
|
|
|
|
createChar_P(LCD_STR_THERMOMETER[0], thermometer);
|
|
|
|
createChar_P(LCD_STR_THERMOMETER[0], thermometer);
|
|
|
@ -351,32 +423,28 @@ static void lcd_set_custom_characters(
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
static bool char_mode = false;
|
|
|
|
if (screen_charset == CHARSET_INFO) { // 3 Progress bar characters for info screen
|
|
|
|
if (info_screen_charset != char_mode) {
|
|
|
|
for (int16_t i = 3; i--;)
|
|
|
|
char_mode = info_screen_charset;
|
|
|
|
createChar_P(LCD_STR_PROGRESS[i], progress[i]);
|
|
|
|
if (info_screen_charset) { // Progress bar characters for info screen
|
|
|
|
|
|
|
|
for (int16_t i = 3; i--;) createChar_P(LCD_STR_PROGRESS[i], progress[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { // Custom characters for submenus
|
|
|
|
else
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
{ // SD Card sub-menu special characters
|
|
|
|
createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
|
|
createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
|
|
createChar_P(LCD_STR_REFRESH[0], refresh);
|
|
|
|
createChar_P(LCD_STR_REFRESH[0], refresh);
|
|
|
|
createChar_P(LCD_STR_FOLDER[0], folder);
|
|
|
|
createChar_P(LCD_STR_FOLDER[0], folder);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
|
|
|
|
|
|
createChar_P(LCD_STR_REFRESH[0], refresh);
|
|
|
|
|
|
|
|
createChar_P(LCD_STR_FOLDER[0], folder);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
// With no SD support, only need the uplevel character
|
|
|
|
createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
|
|
createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void lcd_implementation_init(
|
|
|
|
static void lcd_implementation_init(
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
const bool info_screen_charset = true
|
|
|
|
const uint8_t screen_charset=CHARSET_INFO
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
|
@ -406,7 +474,7 @@ static void lcd_implementation_init(
|
|
|
|
|
|
|
|
|
|
|
|
lcd_set_custom_characters(
|
|
|
|
lcd_set_custom_characters(
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
info_screen_charset
|
|
|
|
screen_charset
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
@ -458,46 +526,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void lcd_bootscreen() {
|
|
|
|
void lcd_bootscreen() {
|
|
|
|
const static PROGMEM byte corner[4][8] = { {
|
|
|
|
lcd_set_custom_characters(CHARSET_BOOT);
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00001,
|
|
|
|
|
|
|
|
B00010,
|
|
|
|
|
|
|
|
B00100,
|
|
|
|
|
|
|
|
B00100
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B11100,
|
|
|
|
|
|
|
|
B11100,
|
|
|
|
|
|
|
|
B01100,
|
|
|
|
|
|
|
|
B00100,
|
|
|
|
|
|
|
|
B00100
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
B00100,
|
|
|
|
|
|
|
|
B00010,
|
|
|
|
|
|
|
|
B00001,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
B00100,
|
|
|
|
|
|
|
|
B01000,
|
|
|
|
|
|
|
|
B10000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000,
|
|
|
|
|
|
|
|
B00000
|
|
|
|
|
|
|
|
} };
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < 4; i++)
|
|
|
|
|
|
|
|
createChar_P(i, corner[i]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcd.clear();
|
|
|
|
lcd.clear();
|
|
|
|
|
|
|
|
|
|
|
|
#define LCD_EXTRA_SPACE (LCD_WIDTH-8)
|
|
|
|
#define LCD_EXTRA_SPACE (LCD_WIDTH-8)
|
|
|
@ -568,11 +597,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
|
|
|
|
|
|
|
|
|
|
|
|
safe_delay(100);
|
|
|
|
safe_delay(100);
|
|
|
|
|
|
|
|
|
|
|
|
lcd_set_custom_characters(
|
|
|
|
lcd_set_custom_characters();
|
|
|
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
|
|
|
|
|
|
false
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SHOW_BOOTSCREEN
|
|
|
|
#endif // SHOW_BOOTSCREEN
|
|
|
|