@@ -214,14 +214,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
214
214
215
215
millis_t MarlinUI::screen_timeout_ms = 0 ;
216
216
void MarlinUI::refresh_screen_timeout () {
217
- screen_timeout_ms = sleep_timeout_minutes ? millis () + sleep_timeout_minutes * 60UL * 1000UL : 0 ;
218
- sleep_display ( false );
217
+ screen_timeout_ms = sleep_timeout_minutes ? millis () + MIN_TO_MS ( sleep_timeout_minutes) : 0 ;
218
+ wake_display ( );
219
219
}
220
220
221
- #if !HAS_TOUCH_SLEEP && !HAS_MARLINUI_U8GLIB // without DOGM (COLOR_UI)
222
- void MarlinUI::sleep_display (const bool sleep) {} // if unimplemented
223
- #endif
224
-
225
221
#endif
226
222
227
223
void MarlinUI::init () {
@@ -766,25 +762,9 @@ void MarlinUI::init() {
766
762
draw_kill_screen ();
767
763
}
768
764
769
- #if HAS_TOUCH_SLEEP
770
- #if HAS_TOUCH_BUTTONS
771
- #include " touch/touch_buttons.h"
772
- #else
773
- #include " tft/touch.h"
774
- #endif
775
- // Wake up a sleeping TFT
776
- void MarlinUI::wakeup_screen () {
777
- TERN (HAS_TOUCH_BUTTONS, touchBt.wakeUp (), touch.wakeUp ());
778
- }
779
- #if HAS_DISPLAY_SLEEP && !HAS_MARLINUI_U8GLIB // without DOGM (COLOR_UI)
780
- void MarlinUI::sleep_display (const bool sleep) {
781
- if (!sleep ) wakeup_screen (); // relay extra wake up events
782
- }
783
- #endif
784
- #endif
785
-
786
765
void MarlinUI::quick_feedback (const bool clear_buttons/* =true*/ ) {
787
- TERN_ (HAS_TOUCH_SLEEP, wakeup_screen ()); // Wake up the TFT with most buttons
766
+ wake_display (); // Wake the screen for any click sound
767
+
788
768
TERN_ (HAS_MARLINUI_MENU, refresh ());
789
769
790
770
#if HAS_ENCODER_ACTION
@@ -1063,7 +1043,7 @@ void MarlinUI::init() {
1063
1043
abs_diff = epps; // Treat as a full step size
1064
1044
encoderDiff = (encoderDiff < 0 ? -1 : 1 ) * abs_diff; // ...in the spin direction.
1065
1045
}
1066
- TERN_ (HAS_TOUCH_SLEEP, if (lastEncoderDiff != encoderDiff) wakeup_screen () );
1046
+ if (lastEncoderDiff != encoderDiff) wake_display ( );
1067
1047
lastEncoderDiff = encoderDiff;
1068
1048
#endif
1069
1049
@@ -1448,14 +1428,14 @@ void MarlinUI::init() {
1448
1428
1449
1429
#endif // HAS_ENCODER_ACTION
1450
1430
1431
+ #endif // HAS_WIRED_LCD
1432
+
1433
+ void MarlinUI::completion_feedback (const bool good/* =true*/ ) {
1434
+ wake_display (); // Wake the screen for all audio feedback
1451
1435
#if HAS_SOUND
1452
- void MarlinUI::completion_feedback (const bool good/* =true*/ ) {
1453
- TERN_ (HAS_TOUCH_SLEEP, wakeup_screen ()); // Wake up on rotary encoder click...
1454
- if (good) OKAY_BUZZ (); else ERR_BUZZ ();
1455
- }
1436
+ if (good) OKAY_BUZZ (); else ERR_BUZZ ();
1456
1437
#endif
1457
-
1458
- #endif // HAS_WIRED_LCD
1438
+ }
1459
1439
1460
1440
void MarlinUI::host_notify_P (PGM_P const pstr) {
1461
1441
TERN_ (HOST_STATUS_NOTIFICATIONS, hostui.notify_P (pstr));
@@ -1574,7 +1554,7 @@ void MarlinUI::host_notify(const char * const cstr) {
1574
1554
*/
1575
1555
void MarlinUI::_set_alert (const char * const ustr, const int8_t level, const bool pgm) {
1576
1556
pgm ? set_status_and_level_P (ustr, level) : set_status_and_level (ustr, level);
1577
- TERN_ (HAS_TOUCH_SLEEP, wakeup_screen () );
1557
+ wake_display ( );
1578
1558
TERN_ (HAS_MARLINUI_MENU, return_to_status ());
1579
1559
}
1580
1560
@@ -1722,7 +1702,8 @@ void MarlinUI::host_notify(const char * const cstr) {
1722
1702
defer_status_screen ();
1723
1703
#endif
1724
1704
1725
- TERN_ (HAS_TOUCH_SLEEP, wakeup_screen ());
1705
+ wake_display ();
1706
+
1726
1707
TERN_ (HOST_PROMPT_SUPPORT, hostui.prompt_open (PROMPT_PAUSE_RESUME, F (" UI Pause" ), F (" Resume" )));
1727
1708
1728
1709
LCD_MESSAGE (MSG_PRINT_PAUSED);
0 commit comments