From 789b2928a8c0343f0c679a8ab29c211c1b235c39 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 30 May 2017 15:07:31 -0500 Subject: [PATCH] Tweak scrolling message code --- Marlin/ultralcd_impl_DOGM.h | 4 ++-- Marlin/ultralcd_impl_HD44780.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index fcda9be68..80f2c4a47 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -410,8 +410,8 @@ inline void lcd_implementation_status_message() { const uint8_t slen = lcd_strlen(lcd_status_message); if (slen > LCD_WIDTH) { // 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; + while (!PRINTABLE(lcd_status_message[status_scroll_pos++])) { /* nada */ } + if (status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0; } #else lcd_print_utf(lcd_status_message); diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index 776ad0aee..9192912a8 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -829,8 +829,8 @@ static void lcd_implementation_status_screen() { const uint8_t slen = lcd_strlen(lcd_status_message); if (slen > LCD_WIDTH) { // 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; + while (!PRINTABLE(lcd_status_message[status_scroll_pos++])) { /* nada */ } + if (status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0; } #else lcd_print_utf(lcd_status_message);