@@ -165,8 +165,9 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
165
165
#endif
166
166
#endif
167
167
168
- #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0
168
+ #if SCREENS_CAN_TIME_OUT
169
169
bool MarlinUI::defer_return_to_status;
170
+ millis_t MarlinUI::return_to_status_ms = 0 ;
170
171
#endif
171
172
172
173
uint8_t MarlinUI::lcd_status_update_delay = 1 ; // First update one loop delayed
@@ -815,9 +816,6 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
815
816
816
817
LCDViewAction MarlinUI::lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
817
818
millis_t next_lcd_update_ms;
818
- #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS
819
- millis_t MarlinUI::return_to_status_ms = 0 ;
820
- #endif
821
819
822
820
inline bool can_encode () {
823
821
return !BUTTON_PRESSED (ENC_EN); // Update encoder only when ENC_EN is not LOW (pressed)
@@ -828,12 +826,6 @@ void MarlinUI::update() {
828
826
static uint16_t max_display_update_time = 0 ;
829
827
millis_t ms = millis ();
830
828
831
- #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0
832
- #define RESET_STATUS_TIMEOUT () (return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS)
833
- #else
834
- #define RESET_STATUS_TIMEOUT () NOOP
835
- #endif
836
-
837
829
#ifdef LED_BACKLIGHT_TIMEOUT
838
830
leds.update_timeout (powersupply_on);
839
831
#endif
@@ -859,7 +851,7 @@ void MarlinUI::update() {
859
851
860
852
#if HAS_TOUCH_BUTTONS
861
853
if (touch_buttons) {
862
- RESET_STATUS_TIMEOUT ( );
854
+ reset_status_timeout (ms );
863
855
if (touch_buttons & (EN_A | EN_B)) { // Menu arrows, in priority
864
856
if (ELAPSED (ms, next_button_update_ms)) {
865
857
encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * epps * encoderDirection;
@@ -914,7 +906,7 @@ void MarlinUI::update() {
914
906
TERN_ (HAS_SLOW_BUTTONS, slow_buttons = read_slow_buttons ()); // Buttons that take too long to read in interrupt context
915
907
916
908
if (TERN0 (IS_RRW_KEYPAD, handle_keypad ()))
917
- RESET_STATUS_TIMEOUT ( );
909
+ reset_status_timeout (ms );
918
910
919
911
uint8_t abs_diff = ABS (encoderDiff);
920
912
@@ -980,7 +972,7 @@ void MarlinUI::update() {
980
972
encoderDiff = 0 ;
981
973
}
982
974
983
- RESET_STATUS_TIMEOUT ( );
975
+ reset_status_timeout (ms );
984
976
985
977
refresh (LCDVIEW_REDRAW_NOW);
986
978
@@ -1006,7 +998,7 @@ void MarlinUI::update() {
1006
998
lcd_status_update_delay = ++filename_scroll_pos >= filename_scroll_max ? 12 : 4 ; // Long delay at end and start
1007
999
if (filename_scroll_pos > filename_scroll_max) filename_scroll_pos = 0 ;
1008
1000
refresh (LCDVIEW_REDRAW_NOW);
1009
- RESET_STATUS_TIMEOUT ( );
1001
+ reset_status_timeout (ms );
1010
1002
}
1011
1003
#endif
1012
1004
@@ -1075,10 +1067,10 @@ void MarlinUI::update() {
1075
1067
NOLESS (max_display_update_time, millis () - ms);
1076
1068
}
1077
1069
1078
- #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0
1070
+ #if SCREENS_CAN_TIME_OUT
1079
1071
// Return to Status Screen after a timeout
1080
1072
if (on_status_screen () || defer_return_to_status)
1081
- RESET_STATUS_TIMEOUT ( );
1073
+ reset_status_timeout (ms );
1082
1074
else if (ELAPSED (ms, return_to_status_ms))
1083
1075
return_to_status ();
1084
1076
#endif
0 commit comments