Maintain message scroll rate

This commit is contained in:
Scott Lahteine 2017-06-04 17:00:11 -05:00
parent 6411d65c48
commit bfe7fbe5c0
2 changed files with 17 additions and 8 deletions

View File

@ -406,12 +406,17 @@ FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr,
inline void lcd_implementation_status_message() { inline void lcd_implementation_status_message() {
#if ENABLED(STATUS_MESSAGE_SCROLLING) #if ENABLED(STATUS_MESSAGE_SCROLLING)
static bool last_blink = false;
lcd_print_utf(lcd_status_message + status_scroll_pos); lcd_print_utf(lcd_status_message + status_scroll_pos);
const uint8_t slen = lcd_strlen(lcd_status_message); const uint8_t slen = lcd_strlen(lcd_status_message);
if (slen > LCD_WIDTH) { if (slen > LCD_WIDTH) {
// Skip any non-printing bytes const bool new_blink = lcd_blink();
while (!PRINTABLE(lcd_status_message[status_scroll_pos++])) { /* nada */ } if (last_blink != new_blink) {
if (status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0; last_blink = new_blink;
// Skip any non-printing bytes
while (!PRINTABLE(lcd_status_message[status_scroll_pos])) status_scroll_pos++;
if (++status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
}
} }
#else #else
lcd_print_utf(lcd_status_message); lcd_print_utf(lcd_status_message);
@ -422,7 +427,7 @@ inline void lcd_implementation_status_message() {
static void lcd_implementation_status_screen() { static void lcd_implementation_status_screen() {
bool blink = lcd_blink(); const bool blink = lcd_blink();
// Status Menu Font // Status Menu Font
lcd_setFont(FONT_STATUSMENU); lcd_setFont(FONT_STATUSMENU);

View File

@ -655,7 +655,7 @@ Possible status screens:
|01234567890123456789| |01234567890123456789|
*/ */
static void lcd_implementation_status_screen() { static void lcd_implementation_status_screen() {
bool blink = lcd_blink(); const bool blink = lcd_blink();
// //
// Line 1 // Line 1
@ -825,12 +825,16 @@ static void lcd_implementation_status_screen() {
#endif // FILAMENT_LCD_DISPLAY && SDSUPPORT #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT
#if ENABLED(STATUS_MESSAGE_SCROLLING) #if ENABLED(STATUS_MESSAGE_SCROLLING)
static bool last_blink = false;
lcd_print_utf(lcd_status_message + status_scroll_pos); lcd_print_utf(lcd_status_message + status_scroll_pos);
const uint8_t slen = lcd_strlen(lcd_status_message); const uint8_t slen = lcd_strlen(lcd_status_message);
if (slen > LCD_WIDTH) { if (slen > LCD_WIDTH) {
// Skip any non-printing bytes if (last_blink != blink) {
while (!PRINTABLE(lcd_status_message[status_scroll_pos++])) { /* nada */ } last_blink = blink;
if (status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0; // Skip any non-printing bytes
while (!PRINTABLE(lcd_status_message[status_scroll_pos])) status_scroll_pos++;
if (++status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
}
} }
#else #else
lcd_print_utf(lcd_status_message); lcd_print_utf(lcd_status_message);