|
@@ -73,6 +73,9 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
73
|
73
|
#endif
|
74
|
74
|
char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1];
|
75
|
75
|
uint8_t MarlinUI::alert_level; // = 0
|
|
76
|
+ #if HAS_STATUS_MESSAGE_TIMEOUT
|
|
77
|
+ millis_t MarlinUI::status_message_expire_ms; // = 0
|
|
78
|
+ #endif
|
76
|
79
|
statusResetFunc_t MarlinUI::status_reset_callback; // = nullptr
|
77
|
80
|
#endif
|
78
|
81
|
|
|
@@ -628,8 +631,17 @@ void MarlinUI::init() {
|
628
|
631
|
|
629
|
632
|
#endif // BASIC_PROGRESS_BAR
|
630
|
633
|
|
631
|
|
- if (status_reset_callback && (*status_reset_callback)())
|
632
|
|
- reset_status();
|
|
634
|
+ bool did_expire = status_reset_callback && (*status_reset_callback)();
|
|
635
|
+
|
|
636
|
+ #if HAS_STATUS_MESSAGE_TIMEOUT
|
|
637
|
+ #ifndef GOT_MS
|
|
638
|
+ #define GOT_MS
|
|
639
|
+ const millis_t ms = millis();
|
|
640
|
+ #endif
|
|
641
|
+ did_expire |= status_message_expire_ms && ELAPSED(ms, status_message_expire_ms);
|
|
642
|
+ #endif
|
|
643
|
+
|
|
644
|
+ if (did_expire) reset_status();
|
633
|
645
|
|
634
|
646
|
#if HAS_MARLINUI_MENU
|
635
|
647
|
if (use_click()) {
|
|
@@ -1521,6 +1533,8 @@ void MarlinUI::init() {
|
1521
|
1533
|
|
1522
|
1534
|
set_status_reset_fn();
|
1523
|
1535
|
|
|
1536
|
+ TERN_(HAS_STATUS_MESSAGE_TIMEOUT, status_message_expire_ms = persist ? 0 : millis() + (STATUS_MESSAGE_TIMEOUT_SEC) * 1000UL);
|
|
1537
|
+
|
1524
|
1538
|
#if HAS_WIRED_LCD
|
1525
|
1539
|
|
1526
|
1540
|
#if BASIC_PROGRESS_BAR || BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
|