Scott Lahteine 7 years ago
parent
commit
76af9ac7c5
2 changed files with 11 additions and 5 deletions
  1. 6
    2
      Marlin/ultralcd_impl_DOGM.h
  2. 5
    3
      Marlin/ultralcd_impl_HD44780.h

+ 6
- 2
Marlin/ultralcd_impl_DOGM.h View File

635
     #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
635
     #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
636
       if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) {  //Display both Status message line and Filament display on the last line
636
       if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) {  //Display both Status message line and Filament display on the last line
637
         const char *str = lcd_status_message;
637
         const char *str = lcd_status_message;
638
-        for (uint8_t i = 0; char c = str[i] && i < LCD_WIDTH; ++i) lcd_print(c);
638
+        uint8_t i = LCD_WIDTH;
639
+        char c;
640
+        while (i-- && (c = *str++)) lcd_print(c);
639
       }
641
       }
640
       else {
642
       else {
641
         lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
643
         lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
648
       }
650
       }
649
     #else
651
     #else
650
       const char *str = lcd_status_message;
652
       const char *str = lcd_status_message;
651
-      for (uint8_t i = 0; char c = str[i] && i < LCD_WIDTH; ++i) lcd_print(c);
653
+      uint8_t i = LCD_WIDTH;
654
+      char c;
655
+      while (i-- && (c = *str++)) lcd_print(c);
652
     #endif
656
     #endif
653
   }
657
   }
654
 }
658
 }

+ 5
- 3
Marlin/ultralcd_impl_HD44780.h View File

386
 }
386
 }
387
 
387
 
388
 void lcd_print(const char* const str) {
388
 void lcd_print(const char* const str) {
389
-  for (uint8_t i = 0; char c = str[i]; ++i) charset_mapper(c);
389
+  for (uint8_t i = 0; const char c = str[i]; ++i) charset_mapper(c);
390
 }
390
 }
391
 
391
 
392
-void lcd_print(char c) { charset_mapper(c); }
392
+void lcd_print(const char c) { charset_mapper(c); }
393
 
393
 
394
 #if ENABLED(SHOW_BOOTSCREEN)
394
 #if ENABLED(SHOW_BOOTSCREEN)
395
 
395
 
796
   #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT
796
   #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT
797
 
797
 
798
   const char *str = lcd_status_message;
798
   const char *str = lcd_status_message;
799
-  for (uint8_t i = 0; char c = str[i] && i < LCD_WIDTH; ++i) lcd_print(c);
799
+  uint8_t i = LCD_WIDTH;
800
+  char c;
801
+  while (i-- && (c = *str++)) lcd_print(c);
800
 }
802
 }
801
 
803
 
802
 #if ENABLED(ULTIPANEL)
804
 #if ENABLED(ULTIPANEL)

Loading…
Cancel
Save