Browse Source

Merge pull request #6816 from thinkyhead/bf_lcd_live_editing

Constrain LCD status message rendering
pull/1/head
Scott Lahteine 8 years ago
committed by GitHub
parent
commit
850203fb3a
  1. 3
      Marlin/ultralcd.cpp
  2. 10
      Marlin/ultralcd_impl_DOGM.h
  3. 9
      Marlin/ultralcd_impl_HD44780.h

3
Marlin/ultralcd.cpp

@ -2509,9 +2509,12 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(EEPROM_SETTINGS)
MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings);
MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings);
#endif
MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings);
#if ENABLED(EEPROM_SETTINGS)
MENU_ITEM(gcode, MSG_INIT_EEPROM, PSTR("M502\nM500")); // TODO: Add "Are You Sure?" step
#endif
END_MENU();
}

10
Marlin/ultralcd_impl_DOGM.h

@ -634,7 +634,10 @@ static void lcd_implementation_status_screen() {
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) { //Display both Status message line and Filament display on the last line
lcd_print(lcd_status_message);
const char *str = lcd_status_message;
uint8_t i = LCD_WIDTH;
char c;
while (i-- && (c = *str++)) lcd_print(c);
}
else {
lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
@ -646,7 +649,10 @@ static void lcd_implementation_status_screen() {
u8g.print('%');
}
#else
lcd_print(lcd_status_message);
const char *str = lcd_status_message;
uint8_t i = LCD_WIDTH;
char c;
while (i-- && (c = *str++)) lcd_print(c);
#endif
}
}

9
Marlin/ultralcd_impl_HD44780.h

@ -386,10 +386,10 @@ void lcd_printPGM(const char *str) {
}
void lcd_print(const char* const str) {
for (uint8_t i = 0; char c = str[i]; ++i) charset_mapper(c);
for (uint8_t i = 0; const char c = str[i]; ++i) charset_mapper(c);
}
void lcd_print(char c) { charset_mapper(c); }
void lcd_print(const char c) { charset_mapper(c); }
#if ENABLED(SHOW_BOOTSCREEN)
@ -795,7 +795,10 @@ static void lcd_implementation_status_screen() {
#endif // FILAMENT_LCD_DISPLAY && SDSUPPORT
lcd_print(lcd_status_message);
const char *str = lcd_status_message;
uint8_t i = LCD_WIDTH;
char c;
while (i-- && (c = *str++)) lcd_print(c);
}
#if ENABLED(ULTIPANEL)

Loading…
Cancel
Save