|
@@ -214,14 +214,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|
|
|
|
|
millis_t MarlinUI::screen_timeout_ms = 0;
|
|
millis_t MarlinUI::screen_timeout_ms = 0;
|
|
void MarlinUI::refresh_screen_timeout() {
|
|
void MarlinUI::refresh_screen_timeout() {
|
|
- screen_timeout_ms = sleep_timeout_minutes ? millis() + sleep_timeout_minutes * 60UL * 1000UL : 0;
|
|
|
|
- sleep_display(false);
|
|
|
|
|
|
+ screen_timeout_ms = sleep_timeout_minutes ? millis() + MIN_TO_MS(sleep_timeout_minutes) : 0;
|
|
|
|
+ wake_display();
|
|
}
|
|
}
|
|
|
|
|
|
- #if !HAS_TOUCH_SLEEP && !HAS_MARLINUI_U8GLIB // without DOGM (COLOR_UI)
|
|
|
|
- void MarlinUI::sleep_display(const bool sleep) {} // if unimplemented
|
|
|
|
- #endif
|
|
|
|
-
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
void MarlinUI::init() {
|
|
void MarlinUI::init() {
|
|
@@ -766,25 +762,9 @@ void MarlinUI::init() {
|
|
draw_kill_screen();
|
|
draw_kill_screen();
|
|
}
|
|
}
|
|
|
|
|
|
- #if HAS_TOUCH_SLEEP
|
|
|
|
- #if HAS_TOUCH_BUTTONS
|
|
|
|
- #include "touch/touch_buttons.h"
|
|
|
|
- #else
|
|
|
|
- #include "tft/touch.h"
|
|
|
|
- #endif
|
|
|
|
- // Wake up a sleeping TFT
|
|
|
|
- void MarlinUI::wakeup_screen() {
|
|
|
|
- TERN(HAS_TOUCH_BUTTONS, touchBt.wakeUp(), touch.wakeUp());
|
|
|
|
- }
|
|
|
|
- #if HAS_DISPLAY_SLEEP && !HAS_MARLINUI_U8GLIB // without DOGM (COLOR_UI)
|
|
|
|
- void MarlinUI::sleep_display(const bool sleep) {
|
|
|
|
- if (!sleep) wakeup_screen(); // relay extra wake up events
|
|
|
|
- }
|
|
|
|
- #endif
|
|
|
|
- #endif
|
|
|
|
-
|
|
|
|
void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
|
|
void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
|
|
- TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); // Wake up the TFT with most buttons
|
|
|
|
|
|
+ wake_display(); // Wake the screen for any click sound
|
|
|
|
+
|
|
TERN_(HAS_MARLINUI_MENU, refresh());
|
|
TERN_(HAS_MARLINUI_MENU, refresh());
|
|
|
|
|
|
#if HAS_ENCODER_ACTION
|
|
#if HAS_ENCODER_ACTION
|
|
@@ -1063,7 +1043,7 @@ void MarlinUI::init() {
|
|
abs_diff = epps; // Treat as a full step size
|
|
abs_diff = epps; // Treat as a full step size
|
|
encoderDiff = (encoderDiff < 0 ? -1 : 1) * abs_diff; // ...in the spin direction.
|
|
encoderDiff = (encoderDiff < 0 ? -1 : 1) * abs_diff; // ...in the spin direction.
|
|
}
|
|
}
|
|
- TERN_(HAS_TOUCH_SLEEP, if (lastEncoderDiff != encoderDiff) wakeup_screen());
|
|
|
|
|
|
+ if (lastEncoderDiff != encoderDiff) wake_display();
|
|
lastEncoderDiff = encoderDiff;
|
|
lastEncoderDiff = encoderDiff;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -1448,14 +1428,14 @@ void MarlinUI::init() {
|
|
|
|
|
|
#endif // HAS_ENCODER_ACTION
|
|
#endif // HAS_ENCODER_ACTION
|
|
|
|
|
|
|
|
+#endif // HAS_WIRED_LCD
|
|
|
|
+
|
|
|
|
+void MarlinUI::completion_feedback(const bool good/*=true*/) {
|
|
|
|
+ wake_display(); // Wake the screen for all audio feedback
|
|
#if HAS_SOUND
|
|
#if HAS_SOUND
|
|
- void MarlinUI::completion_feedback(const bool good/*=true*/) {
|
|
|
|
- TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); // Wake up on rotary encoder click...
|
|
|
|
- if (good) OKAY_BUZZ(); else ERR_BUZZ();
|
|
|
|
- }
|
|
|
|
|
|
+ if (good) OKAY_BUZZ(); else ERR_BUZZ();
|
|
#endif
|
|
#endif
|
|
-
|
|
|
|
-#endif // HAS_WIRED_LCD
|
|
|
|
|
|
+}
|
|
|
|
|
|
void MarlinUI::host_notify_P(PGM_P const pstr) {
|
|
void MarlinUI::host_notify_P(PGM_P const pstr) {
|
|
TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify_P(pstr));
|
|
TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify_P(pstr));
|
|
@@ -1574,7 +1554,7 @@ void MarlinUI::host_notify(const char * const cstr) {
|
|
*/
|
|
*/
|
|
void MarlinUI::_set_alert(const char * const ustr, const int8_t level, const bool pgm) {
|
|
void MarlinUI::_set_alert(const char * const ustr, const int8_t level, const bool pgm) {
|
|
pgm ? set_status_and_level_P(ustr, level) : set_status_and_level(ustr, level);
|
|
pgm ? set_status_and_level_P(ustr, level) : set_status_and_level(ustr, level);
|
|
- TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
|
|
|
|
|
|
+ wake_display();
|
|
TERN_(HAS_MARLINUI_MENU, return_to_status());
|
|
TERN_(HAS_MARLINUI_MENU, return_to_status());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1722,7 +1702,8 @@ void MarlinUI::host_notify(const char * const cstr) {
|
|
defer_status_screen();
|
|
defer_status_screen();
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
|
|
|
|
|
|
+ wake_display();
|
|
|
|
+
|
|
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_PAUSE_RESUME, F("UI Pause"), F("Resume")));
|
|
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_PAUSE_RESUME, F("UI Pause"), F("Resume")));
|
|
|
|
|
|
LCD_MESSAGE(MSG_PRINT_PAUSED);
|
|
LCD_MESSAGE(MSG_PRINT_PAUSED);
|