Unify status scrolling further

This commit is contained in:
Scott Lahteine
2019-03-17 05:32:12 -05:00
parent c4443f885e
commit 58bca67883
5 changed files with 56 additions and 89 deletions

View File

@ -1162,6 +1162,21 @@ void MarlinUI::update() {
/////////////// Status Line ////////////////
////////////////////////////////////////////
#if ENABLED(STATUS_MESSAGE_SCROLLING)
void MarlinUI::advance_status_scroll() {
// Advance by one UTF8 code-word
if (status_scroll_offset < utf8_strlen(status_message))
while (!START_OF_UTF8_CHAR(status_message[++status_scroll_offset]));
else
status_scroll_offset = 0;
}
char* MarlinUI::status_and_len(uint8_t &len) {
char *out = status_message + status_scroll_offset;
len = utf8_strlen(out);
return out;
}
#endif
void MarlinUI::finish_status(const bool persist) {
#if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0))
@ -1179,7 +1194,7 @@ void MarlinUI::update() {
next_filament_display = millis() + 5000UL; // Show status message for 5s
#endif
#if ENABLED(STATUS_MESSAGE_SCROLLING)
#if HAS_SPI_LCD && ENABLED(STATUS_MESSAGE_SCROLLING)
status_scroll_offset = 0;
#endif