|
@@ -239,19 +239,17 @@ char lcd_print_and_count(const char c) {
|
239
|
239
|
* On DOGM all strings go through a filter for utf
|
240
|
240
|
* But only use lcd_print_utf and lcd_printPGM_utf for translated text
|
241
|
241
|
*/
|
242
|
|
-void lcd_print(const char* const str) { for (uint8_t i = 0; char c = str[i]; ++i) lcd_print(c); }
|
243
|
|
-void lcd_printPGM(const char* str) { for (; char c = pgm_read_byte(str); ++str) lcd_print(c); }
|
|
242
|
+void lcd_print(const char *str) { while (*str) lcd_print(*str++); }
|
|
243
|
+void lcd_printPGM(const char *str) { while (const char c = pgm_read_byte(str)) lcd_print(c), ++str; }
|
244
|
244
|
|
245
|
|
-void lcd_print_utf(const char* const str, const uint8_t maxLength=LCD_WIDTH) {
|
|
245
|
+void lcd_print_utf(const char *str, uint8_t n=LCD_WIDTH) {
|
246
|
246
|
char c;
|
247
|
|
- for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
|
248
|
|
- n -= charset_mapper(c);
|
|
247
|
+ while (n && (c = *str)) n -= charset_mapper(c), ++str;
|
249
|
248
|
}
|
250
|
249
|
|
251
|
|
-void lcd_printPGM_utf(const char* str, const uint8_t maxLength=LCD_WIDTH) {
|
|
250
|
+void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
|
252
|
251
|
char c;
|
253
|
|
- for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
|
254
|
|
- n -= charset_mapper(c);
|
|
252
|
+ while (n && (c = pgm_read_byte(str))) n -= charset_mapper(c), ++str;
|
255
|
253
|
}
|
256
|
254
|
|
257
|
255
|
// Initialize or re-initialize the LCD
|