@@ -593,7 +593,7 @@ void MarlinUI::init() {
593
593
// share the same line on the display.
594
594
//
595
595
596
- #if DISABLED(PROGRESS_MSG_ONCE) || ( PROGRESS_MSG_EXPIRE > 0)
596
+ #if DISABLED(PROGRESS_MSG_ONCE) || PROGRESS_MSG_EXPIRE > 0
597
597
#define GOT_MS
598
598
const millis_t ms = millis ();
599
599
#endif
@@ -1420,6 +1420,7 @@ void MarlinUI::init() {
1420
1420
#if SERVICE_INTERVAL_3 > 0
1421
1421
static PGMSTR (service3, " > " SERVICE_NAME_3 " !" );
1422
1422
#endif
1423
+
1423
1424
FSTR_P msg;
1424
1425
if (printingIsPaused ())
1425
1426
msg = GET_TEXT_F (MSG_PRINT_PAUSED);
@@ -1450,13 +1451,18 @@ void MarlinUI::init() {
1450
1451
set_status (msg, -1 );
1451
1452
}
1452
1453
1454
+ /* *
1455
+ * Set Status with a fixed string and alert level.
1456
+ * @param fstr A constant F-string to set as the status.
1457
+ * @param level Alert level. Negative to ignore and reset the level. Non-zero never expires.
1458
+ */
1453
1459
void MarlinUI::set_status (FSTR_P const fstr, int8_t level) {
1454
- PGM_P const pstr = FTOP (fstr);
1460
+ // Alerts block lower priority messages
1455
1461
if (level < 0 ) level = alert_level = 0 ;
1456
1462
if (level < alert_level) return ;
1457
1463
alert_level = level;
1458
1464
1459
- TERN_ (HOST_STATUS_NOTIFICATIONS, hostui. notify (fstr) );
1465
+ PGM_P const pstr = FTOP (fstr);
1460
1466
1461
1467
// Since the message is encoded in UTF8 it must
1462
1468
// only be cut on a character boundary.
@@ -1476,6 +1482,8 @@ void MarlinUI::init() {
1476
1482
strncpy_P (status_message, pstr, maxLen);
1477
1483
status_message[maxLen] = ' \0 ' ;
1478
1484
1485
+ TERN_ (HOST_STATUS_NOTIFICATIONS, hostui.notify (fstr));
1486
+
1479
1487
finish_status (level > 0 );
1480
1488
}
1481
1489
0 commit comments