Browse Source

Maintain message scroll rate

Scott Lahteine 7 years ago
parent
commit
bfe7fbe5c0
2 changed files with 17 additions and 8 deletions
  1. 9
    4
      Marlin/ultralcd_impl_DOGM.h
  2. 8
    4
      Marlin/ultralcd_impl_HD44780.h

+ 9
- 4
Marlin/ultralcd_impl_DOGM.h View File

@@ -406,12 +406,17 @@ FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr,
406 406
 
407 407
 inline void lcd_implementation_status_message() {
408 408
   #if ENABLED(STATUS_MESSAGE_SCROLLING)
409
+    static bool last_blink = false;
409 410
     lcd_print_utf(lcd_status_message + status_scroll_pos);
410 411
     const uint8_t slen = lcd_strlen(lcd_status_message);
411 412
     if (slen > LCD_WIDTH) {
412
-      // Skip any non-printing bytes
413
-      while (!PRINTABLE(lcd_status_message[status_scroll_pos++])) { /* nada */ }
414
-      if (status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
413
+      const bool new_blink = lcd_blink();
414
+      if (last_blink != new_blink) {
415
+        last_blink = new_blink;
416
+        // Skip any non-printing bytes
417
+        while (!PRINTABLE(lcd_status_message[status_scroll_pos])) status_scroll_pos++;
418
+        if (++status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
419
+      }
415 420
     }
416 421
   #else
417 422
     lcd_print_utf(lcd_status_message);
@@ -422,7 +427,7 @@ inline void lcd_implementation_status_message() {
422 427
 
423 428
 static void lcd_implementation_status_screen() {
424 429
 
425
-  bool blink = lcd_blink();
430
+  const bool blink = lcd_blink();
426 431
 
427 432
   // Status Menu Font
428 433
   lcd_setFont(FONT_STATUSMENU);

+ 8
- 4
Marlin/ultralcd_impl_HD44780.h View File

@@ -655,7 +655,7 @@ Possible status screens:
655 655
        |01234567890123456789|
656 656
 */
657 657
 static void lcd_implementation_status_screen() {
658
-  bool blink = lcd_blink();
658
+  const bool blink = lcd_blink();
659 659
 
660 660
   //
661 661
   // Line 1
@@ -825,12 +825,16 @@ static void lcd_implementation_status_screen() {
825 825
   #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT
826 826
 
827 827
   #if ENABLED(STATUS_MESSAGE_SCROLLING)
828
+    static bool last_blink = false;
828 829
     lcd_print_utf(lcd_status_message + status_scroll_pos);
829 830
     const uint8_t slen = lcd_strlen(lcd_status_message);
830 831
     if (slen > LCD_WIDTH) {
831
-      // Skip any non-printing bytes
832
-      while (!PRINTABLE(lcd_status_message[status_scroll_pos++])) { /* nada */ }
833
-      if (status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
832
+      if (last_blink != blink) {
833
+        last_blink = blink;
834
+        // Skip any non-printing bytes
835
+        while (!PRINTABLE(lcd_status_message[status_scroll_pos])) status_scroll_pos++;
836
+        if (++status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
837
+      }
834 838
     }
835 839
   #else
836 840
     lcd_print_utf(lcd_status_message);

Loading…
Cancel
Save