|
@ -3885,11 +3885,7 @@ void lcd_init() { |
|
|
int lcd_strlen(const char* s) { |
|
|
int lcd_strlen(const char* s) { |
|
|
int i = 0, j = 0; |
|
|
int i = 0, j = 0; |
|
|
while (s[i]) { |
|
|
while (s[i]) { |
|
|
#if ENABLED(MAPPER_NON) |
|
|
|
|
|
j++; |
|
|
|
|
|
#else |
|
|
|
|
|
if (PRINTABLE(s[i])) j++; |
|
|
if (PRINTABLE(s[i])) j++; |
|
|
#endif |
|
|
|
|
|
i++; |
|
|
i++; |
|
|
} |
|
|
} |
|
|
return j; |
|
|
return j; |
|
@ -3898,11 +3894,7 @@ int lcd_strlen(const char* s) { |
|
|
int lcd_strlen_P(const char* s) { |
|
|
int lcd_strlen_P(const char* s) { |
|
|
int j = 0; |
|
|
int j = 0; |
|
|
while (pgm_read_byte(s)) { |
|
|
while (pgm_read_byte(s)) { |
|
|
#if ENABLED(MAPPER_NON) |
|
|
|
|
|
j++; |
|
|
|
|
|
#else |
|
|
|
|
|
if (PRINTABLE(pgm_read_byte(s))) j++; |
|
|
if (PRINTABLE(pgm_read_byte(s))) j++; |
|
|
#endif |
|
|
|
|
|
s++; |
|
|
s++; |
|
|
} |
|
|
} |
|
|
return j; |
|
|
return j; |
|
@ -4167,11 +4159,7 @@ void lcd_update() { |
|
|
void set_utf_strlen(char* s, uint8_t n) { |
|
|
void set_utf_strlen(char* s, uint8_t n) { |
|
|
uint8_t i = 0, j = 0; |
|
|
uint8_t i = 0, j = 0; |
|
|
while (s[i] && (j < n)) { |
|
|
while (s[i] && (j < n)) { |
|
|
#if ENABLED(MAPPER_NON) |
|
|
|
|
|
j++; |
|
|
|
|
|
#else |
|
|
|
|
|
if (PRINTABLE(s[i])) j++; |
|
|
if (PRINTABLE(s[i])) j++; |
|
|
#endif |
|
|
|
|
|
i++; |
|
|
i++; |
|
|
} |
|
|
} |
|
|
while (j++ < n) s[i++] = ' '; |
|
|
while (j++ < n) s[i++] = ' '; |
|
|