|
@@ -4154,24 +4154,28 @@ void lcd_update() {
|
4154
|
4154
|
} // ELAPSED(ms, next_lcd_update_ms)
|
4155
|
4155
|
}
|
4156
|
4156
|
|
4157
|
|
-#if DISABLED(STATUS_MESSAGE_SCROLLING)
|
4158
|
|
-
|
4159
|
|
- void set_utf_strlen(char* s, uint8_t n) {
|
4160
|
|
- uint8_t i = 0, j = 0;
|
4161
|
|
- while (s[i] && (j < n)) {
|
4162
|
|
- if (PRINTABLE(s[i])) j++;
|
4163
|
|
- i++;
|
4164
|
|
- }
|
4165
|
|
- while (j++ < n) s[i++] = ' ';
|
4166
|
|
- s[i] = '\0';
|
|
4157
|
+void pad_message_string() {
|
|
4158
|
+ uint8_t i = 0, j = 0;
|
|
4159
|
+ char c;
|
|
4160
|
+ while ((c = lcd_status_message[i]) && j < LCD_WIDTH) {
|
|
4161
|
+ if (PRINTABLE(c)) j++;
|
|
4162
|
+ i++;
|
4167
|
4163
|
}
|
4168
|
|
-
|
4169
|
|
-#endif // !STATUS_MESSAGE_SCROLLING
|
|
4164
|
+ if (true
|
|
4165
|
+ #if ENABLED(STATUS_MESSAGE_SCROLLING)
|
|
4166
|
+ && j < LCD_WIDTH
|
|
4167
|
+ #endif
|
|
4168
|
+ ) {
|
|
4169
|
+ // pad with spaces to fill up the line
|
|
4170
|
+ while (j++ < LCD_WIDTH) lcd_status_message[i++] = ' ';
|
|
4171
|
+ // chop off at the edge
|
|
4172
|
+ lcd_status_message[i] = '\0';
|
|
4173
|
+ }
|
|
4174
|
+}
|
4170
|
4175
|
|
4171
|
4176
|
void lcd_finishstatus(bool persist=false) {
|
4172
|
|
- #if DISABLED(STATUS_MESSAGE_SCROLLING)
|
4173
|
|
- set_utf_strlen(lcd_status_message, LCD_WIDTH);
|
4174
|
|
- #endif
|
|
4177
|
+
|
|
4178
|
+ pad_message_string();
|
4175
|
4179
|
|
4176
|
4180
|
#if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0))
|
4177
|
4181
|
UNUSED(persist);
|