parent
9364cbb4b5
commit
1dee4d92c6
@ -3414,7 +3414,6 @@
|
|||||||
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus
|
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus
|
||||||
|
|
||||||
//#define DISABLE_ENCODER // Disable the click encoder, if any
|
//#define DISABLE_ENCODER // Disable the click encoder, if any
|
||||||
//#define TOUCH_IDLE_SLEEP_MINS 5 // (minutes) Display Sleep after a period of inactivity. Set with M255 S.
|
|
||||||
|
|
||||||
#define TOUCH_SCREEN_CALIBRATION
|
#define TOUCH_SCREEN_CALIBRATION
|
||||||
|
|
||||||
|
@ -1970,17 +1970,6 @@
|
|||||||
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
|
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
|
||||||
//#define USE_SMALL_INFOFONT
|
//#define USE_SMALL_INFOFONT
|
||||||
|
|
||||||
/**
|
|
||||||
* Graphical Display Sleep
|
|
||||||
*
|
|
||||||
* The U8G library provides sleep / wake functions for SH1106, SSD1306,
|
|
||||||
* SSD1309, and some other DOGM displays.
|
|
||||||
* Enable this option to save energy and prevent OLED pixel burn-in.
|
|
||||||
* Adds the menu item Configuration > LCD Timeout (m) to set a wait period
|
|
||||||
* from 0 (disabled) to 99 minutes.
|
|
||||||
*/
|
|
||||||
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen. Set with M255 S.
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ST7920-based LCDs can emulate a 16 x 4 character display using
|
* ST7920-based LCDs can emulate a 16 x 4 character display using
|
||||||
* the ST7920 character-generator for very fast screen updates.
|
* the ST7920 character-generator for very fast screen updates.
|
||||||
@ -2229,13 +2218,20 @@
|
|||||||
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
|
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
/**
|
||||||
// LCD Backlight Timeout
|
* Display Sleep
|
||||||
// Requires a display with a controllable backlight
|
* Enable this option to save energy and prevent OLED pixel burn-in.
|
||||||
//
|
*/
|
||||||
|
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LCD Backlight Timeout
|
||||||
|
* Requires a display with a controllable backlight
|
||||||
|
*/
|
||||||
//#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight
|
//#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight
|
||||||
|
|
||||||
#if defined(DISPLAY_SLEEP_MINUTES) || defined(LCD_BACKLIGHT_TIMEOUT_MINS)
|
#if defined(DISPLAY_SLEEP_MINUTES) || defined(LCD_BACKLIGHT_TIMEOUT_MINS)
|
||||||
#define EDITABLE_DISPLAY_TIMEOUT // Edit timeout with M255 S<minutes> and a menu item
|
#define EDITABLE_DISPLAY_TIMEOUT // Edit sleep / backlight timeout with M255 S<minutes> and a menu item
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -600,7 +600,9 @@
|
|||||||
#elif defined(LEVEL_CENTER_TOO)
|
#elif defined(LEVEL_CENTER_TOO)
|
||||||
#error "LEVEL_CENTER_TOO is now BED_TRAMMING_INCLUDE_CENTER."
|
#error "LEVEL_CENTER_TOO is now BED_TRAMMING_INCLUDE_CENTER."
|
||||||
#elif defined(TOUCH_IDLE_SLEEP)
|
#elif defined(TOUCH_IDLE_SLEEP)
|
||||||
#error "TOUCH_IDLE_SLEEP (seconds) is now TOUCH_IDLE_SLEEP_MINS (minutes)."
|
#error "TOUCH_IDLE_SLEEP (seconds) is now DISPLAY_SLEEP_MINUTES (minutes)."
|
||||||
|
#elif defined(TOUCH_IDLE_SLEEP_MINS)
|
||||||
|
#error "TOUCH_IDLE_SLEEP_MINS is now DISPLAY_SLEEP_MINUTES."
|
||||||
#elif defined(LCD_BACKLIGHT_TIMEOUT)
|
#elif defined(LCD_BACKLIGHT_TIMEOUT)
|
||||||
#error "LCD_BACKLIGHT_TIMEOUT (seconds) is now LCD_BACKLIGHT_TIMEOUT_MINS (minutes)."
|
#error "LCD_BACKLIGHT_TIMEOUT (seconds) is now LCD_BACKLIGHT_TIMEOUT_MINS (minutes)."
|
||||||
#elif defined(LCD_SET_PROGRESS_MANUALLY)
|
#elif defined(LCD_SET_PROGRESS_MANUALLY)
|
||||||
|
@ -1850,9 +1850,6 @@
|
|||||||
|
|
||||||
// This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046'
|
// This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046'
|
||||||
#if ENABLED(TOUCH_SCREEN)
|
#if ENABLED(TOUCH_SCREEN)
|
||||||
#if TOUCH_IDLE_SLEEP_MINS
|
|
||||||
#define HAS_TOUCH_SLEEP 1
|
|
||||||
#endif
|
|
||||||
#if NONE(TFT_TOUCH_DEVICE_GT911, TFT_TOUCH_DEVICE_XPT2046)
|
#if NONE(TFT_TOUCH_DEVICE_GT911, TFT_TOUCH_DEVICE_XPT2046)
|
||||||
#define TFT_TOUCH_DEVICE_XPT2046 // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
|
#define TFT_TOUCH_DEVICE_XPT2046 // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
|
||||||
#endif
|
#endif
|
||||||
|
@ -912,7 +912,7 @@
|
|||||||
#if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, HAS_MEDIA)
|
#if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, HAS_MEDIA)
|
||||||
#define HAS_LEDS_OFF_FLAG 1
|
#define HAS_LEDS_OFF_FLAG 1
|
||||||
#endif
|
#endif
|
||||||
#if defined(DISPLAY_SLEEP_MINUTES) || defined(TOUCH_IDLE_SLEEP_MINS)
|
#ifdef DISPLAY_SLEEP_MINUTES
|
||||||
#define HAS_DISPLAY_SLEEP 1
|
#define HAS_DISPLAY_SLEEP 1
|
||||||
#endif
|
#endif
|
||||||
#ifdef LCD_BACKLIGHT_TIMEOUT_MINS
|
#ifdef LCD_BACKLIGHT_TIMEOUT_MINS
|
||||||
|
@ -2785,6 +2785,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
|
|||||||
#if HAS_BACKLIGHT_TIMEOUT
|
#if HAS_BACKLIGHT_TIMEOUT
|
||||||
#if !HAS_ENCODER_ACTION && DISABLED(HAS_DWIN_E3V2)
|
#if !HAS_ENCODER_ACTION && DISABLED(HAS_DWIN_E3V2)
|
||||||
#error "LCD_BACKLIGHT_TIMEOUT_MINS requires an LCD with encoder or keypad."
|
#error "LCD_BACKLIGHT_TIMEOUT_MINS requires an LCD with encoder or keypad."
|
||||||
|
#elif HAS_DISPLAY_SLEEP
|
||||||
|
#error "LCD_BACKLIGHT_TIMEOUT_MINS and DISPLAY_SLEEP_MINUTES are not currently supported at the same time."
|
||||||
#elif ENABLED(NEOPIXEL_BKGD_INDEX_FIRST)
|
#elif ENABLED(NEOPIXEL_BKGD_INDEX_FIRST)
|
||||||
#if PIN_EXISTS(LCD_BACKLIGHT)
|
#if PIN_EXISTS(LCD_BACKLIGHT)
|
||||||
#error "LCD_BACKLIGHT_PIN and NEOPIXEL_BKGD_INDEX_FIRST are not supported at the same time."
|
#error "LCD_BACKLIGHT_PIN and NEOPIXEL_BKGD_INDEX_FIRST are not supported at the same time."
|
||||||
@ -2794,6 +2796,15 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
|
|||||||
#elif !PIN_EXISTS(LCD_BACKLIGHT) && DISABLED(HAS_DWIN_E3V2)
|
#elif !PIN_EXISTS(LCD_BACKLIGHT) && DISABLED(HAS_DWIN_E3V2)
|
||||||
#error "LCD_BACKLIGHT_TIMEOUT_MINS requires LCD_BACKLIGHT_PIN, NEOPIXEL_BKGD_INDEX_FIRST, or an Ender-3 V2 DWIN LCD."
|
#error "LCD_BACKLIGHT_TIMEOUT_MINS requires LCD_BACKLIGHT_PIN, NEOPIXEL_BKGD_INDEX_FIRST, or an Ender-3 V2 DWIN LCD."
|
||||||
#endif
|
#endif
|
||||||
|
#elif HAS_DISPLAY_SLEEP
|
||||||
|
#if NONE(TOUCH_SCREEN, HAS_MARLINUI_U8GLIB) || ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI_12864, CR10_STOCKDISPLAY, MINIPANEL)
|
||||||
|
#error "DISPLAY_SLEEP_MINUTES is not supported by your display."
|
||||||
|
#undef HAS_DISPLAY_SLEEP
|
||||||
|
#elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255)
|
||||||
|
#error "DISPLAY_SLEEP_MINUTES must be between 0 and 255."
|
||||||
|
#elif DISABLED(EDITABLE_DISPLAY_TIMEOUT) && DISPLAY_SLEEP_MINUTES == 0
|
||||||
|
#error "DISPLAY_SLEEP_MINUTES must be greater than 0 with EDITABLE_DISPLAY_TIMEOUT disabled."
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Startup Tune requirements
|
// Startup Tune requirements
|
||||||
@ -2806,17 +2817,6 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* Display Sleep is not supported by these common displays
|
|
||||||
*/
|
|
||||||
#if HAS_DISPLAY_SLEEP
|
|
||||||
#if ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI_12864, CR10_STOCKDISPLAY, MINIPANEL)
|
|
||||||
#error "DISPLAY_SLEEP_MINUTES is not supported by your display."
|
|
||||||
#elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255)
|
|
||||||
#error "DISPLAY_SLEEP_MINUTES must be between 0 and 255."
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Some boards forbid the use of -1 Native USB
|
* Some boards forbid the use of -1 Native USB
|
||||||
*/
|
*/
|
||||||
|
@ -377,7 +377,7 @@ void MarlinUI::draw_kill_screen() {
|
|||||||
void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||||
|
|
||||||
#if HAS_DISPLAY_SLEEP
|
#if HAS_DISPLAY_SLEEP
|
||||||
void MarlinUI::sleep_display(const bool sleep) { sleep ? u8g.sleepOn() : u8g.sleepOff(); }
|
void MarlinUI::sleep_display(const bool sleep/*=true*/) { sleep ? u8g.sleepOn() : u8g.sleepOff(); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_LCD_BRIGHTNESS
|
#if HAS_LCD_BRIGHTNESS
|
||||||
|
@ -78,10 +78,6 @@ TFT_IO tftio;
|
|||||||
#include "../marlinui.h"
|
#include "../marlinui.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_TOUCH_BUTTONS && HAS_TOUCH_SLEEP
|
|
||||||
#define HAS_TOUCH_BUTTONS_SLEEP 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../touch/touch_buttons.h"
|
#include "../touch/touch_buttons.h"
|
||||||
#include "../scaled_tft.h"
|
#include "../scaled_tft.h"
|
||||||
|
|
||||||
@ -389,25 +385,29 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
|
|||||||
|
|
||||||
case U8G_DEV_MSG_PAGE_FIRST: {
|
case U8G_DEV_MSG_PAGE_FIRST: {
|
||||||
page = 0;
|
page = 0;
|
||||||
#if HAS_TOUCH_BUTTONS_SLEEP
|
#if HAS_TOUCH_BUTTONS
|
||||||
|
#if HAS_DISPLAY_SLEEP
|
||||||
static bool sleepCleared;
|
static bool sleepCleared;
|
||||||
if (touchBt.isSleeping()) {
|
if (touchBt.isSleeping()) {
|
||||||
if (!sleepCleared) {
|
if (!sleepCleared) {
|
||||||
sleepCleared = true;
|
sleepCleared = true;
|
||||||
u8g_upscale_clear_lcd(u8g, dev, buffer);
|
u8g_upscale_clear_lcd(u8g, dev, buffer);
|
||||||
TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true);
|
redrawTouchButtons = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sleepCleared = false;
|
sleepCleared = false;
|
||||||
#endif
|
#endif
|
||||||
TERN_(HAS_TOUCH_BUTTONS, drawTouchButtons(u8g, dev));
|
drawTouchButtons(u8g, dev);
|
||||||
|
#endif
|
||||||
setWindow(u8g, dev, TFT_PIXEL_OFFSET_X, TFT_PIXEL_OFFSET_Y, X_HI, Y_HI);
|
setWindow(u8g, dev, TFT_PIXEL_OFFSET_X, TFT_PIXEL_OFFSET_Y, X_HI, Y_HI);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case U8G_DEV_MSG_PAGE_NEXT:
|
case U8G_DEV_MSG_PAGE_NEXT:
|
||||||
if (TERN0(HAS_TOUCH_BUTTONS_SLEEP, touchBt.isSleeping())) break;
|
#if HAS_TOUCH_BUTTONS && HAS_DISPLAY_SLEEP
|
||||||
|
if (touchBt.isSleeping()) break;
|
||||||
|
#endif
|
||||||
if (++page > (HEIGHT / PAGE_HEIGHT)) return 1;
|
if (++page > (HEIGHT / PAGE_HEIGHT)) return 1;
|
||||||
|
|
||||||
for (uint8_t y = 0; y < PAGE_HEIGHT; ++y) {
|
for (uint8_t y = 0; y < PAGE_HEIGHT; ++y) {
|
||||||
|
@ -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;
|
screen_timeout_ms = sleep_timeout_minutes ? millis() + MIN_TO_MS(sleep_timeout_minutes) : 0;
|
||||||
sleep_display(false);
|
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,15 +1428,15 @@ void MarlinUI::init() {
|
|||||||
|
|
||||||
#endif // HAS_ENCODER_ACTION
|
#endif // HAS_ENCODER_ACTION
|
||||||
|
|
||||||
#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();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // HAS_WIRED_LCD
|
#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 (good) OKAY_BUZZ(); else ERR_BUZZ();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
@ -292,9 +292,11 @@ public:
|
|||||||
static constexpr uint8_t sleep_timeout_max = 99;
|
static constexpr uint8_t sleep_timeout_max = 99;
|
||||||
static millis_t screen_timeout_ms;
|
static millis_t screen_timeout_ms;
|
||||||
static void refresh_screen_timeout();
|
static void refresh_screen_timeout();
|
||||||
static void sleep_display(const bool sleep=true);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void sleep_display(const bool=true) IF_DISABLED(HAS_DISPLAY_SLEEP, {});
|
||||||
|
static void wake_display() { sleep_display(false); }
|
||||||
|
|
||||||
#if HAS_DWIN_E3V2_BASIC
|
#if HAS_DWIN_E3V2_BASIC
|
||||||
static void refresh();
|
static void refresh();
|
||||||
#else
|
#else
|
||||||
@ -582,16 +584,7 @@ public:
|
|||||||
static void pause_filament_display(const millis_t ms=millis()) { next_filament_display = ms + 5000UL; }
|
static void pause_filament_display(const millis_t ms=millis()) { next_filament_display = ms + 5000UL; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_TOUCH_SLEEP
|
|
||||||
static void wakeup_screen();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void quick_feedback(const bool clear_buttons=true);
|
static void quick_feedback(const bool clear_buttons=true);
|
||||||
#if HAS_SOUND
|
|
||||||
static void completion_feedback(const bool good=true);
|
|
||||||
#else
|
|
||||||
static void completion_feedback(const bool=true) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||||
static void draw_hotend_status(const uint8_t row, const uint8_t extruder);
|
static void draw_hotend_status(const uint8_t row, const uint8_t extruder);
|
||||||
@ -604,7 +597,7 @@ public:
|
|||||||
|
|
||||||
static void status_screen();
|
static void status_screen();
|
||||||
|
|
||||||
#endif
|
#endif // HAS_WIRED_LCD
|
||||||
|
|
||||||
#if HAS_MARLINUI_U8GLIB
|
#if HAS_MARLINUI_U8GLIB
|
||||||
static bool drawing_screen, first_page;
|
static bool drawing_screen, first_page;
|
||||||
@ -635,9 +628,10 @@ public:
|
|||||||
|
|
||||||
#if !HAS_WIRED_LCD
|
#if !HAS_WIRED_LCD
|
||||||
static void quick_feedback(const bool=true) {}
|
static void quick_feedback(const bool=true) {}
|
||||||
static void completion_feedback(const bool=true) {}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void completion_feedback(const bool good=true);
|
||||||
|
|
||||||
#if HAS_MEDIA
|
#if HAS_MEDIA
|
||||||
#if ALL(SCROLL_LONG_FILENAMES, HAS_MARLINUI_MENU)
|
#if ALL(SCROLL_LONG_FILENAMES, HAS_MARLINUI_MENU)
|
||||||
#define MARLINUI_SCROLL_NAME 1
|
#define MARLINUI_SCROLL_NAME 1
|
||||||
|
@ -168,6 +168,9 @@ void MenuEditItemBase::goto_edit_screen(
|
|||||||
*/
|
*/
|
||||||
void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) {
|
void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) {
|
||||||
if (currentScreen != screen) {
|
if (currentScreen != screen) {
|
||||||
|
|
||||||
|
wake_display();
|
||||||
|
|
||||||
thermalManager.set_menu_cold_override(false);
|
thermalManager.set_menu_cold_override(false);
|
||||||
|
|
||||||
TERN_(IS_DWIN_MARLINUI, did_first_redraw = false);
|
TERN_(IS_DWIN_MARLINUI, did_first_redraw = false);
|
||||||
|
@ -48,7 +48,6 @@ void lcd_sd_updir() {
|
|||||||
goto_screen(menu_media, sd_encoder_position, sd_top_line, sd_items);
|
goto_screen(menu_media, sd_encoder_position, sd_top_line, sd_items);
|
||||||
sd_encoder_position = 0xFFFF;
|
sd_encoder_position = 0xFFFF;
|
||||||
defer_status_screen();
|
defer_status_screen();
|
||||||
TERN_(HAS_TOUCH_SLEEP, ui.wakeup_screen());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -38,6 +38,8 @@
|
|||||||
|
|
||||||
#include "tft.h"
|
#include "tft.h"
|
||||||
|
|
||||||
|
Touch touch;
|
||||||
|
|
||||||
bool Touch::enabled = true;
|
bool Touch::enabled = true;
|
||||||
int16_t Touch::x, Touch::y;
|
int16_t Touch::x, Touch::y;
|
||||||
touch_control_t Touch::controls[];
|
touch_control_t Touch::controls[];
|
||||||
@ -48,7 +50,7 @@ millis_t Touch::next_touch_ms = 0,
|
|||||||
Touch::repeat_delay,
|
Touch::repeat_delay,
|
||||||
Touch::touch_time;
|
Touch::touch_time;
|
||||||
TouchControlType Touch::touch_control_type = NONE;
|
TouchControlType Touch::touch_control_type = NONE;
|
||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_DISPLAY_SLEEP
|
||||||
millis_t Touch::next_sleep_ms; // = 0
|
millis_t Touch::next_sleep_ms; // = 0
|
||||||
#endif
|
#endif
|
||||||
#if HAS_RESUME_CONTINUE
|
#if HAS_RESUME_CONTINUE
|
||||||
@ -59,7 +61,7 @@ void Touch::init() {
|
|||||||
TERN_(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration_reset());
|
TERN_(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration_reset());
|
||||||
reset();
|
reset();
|
||||||
io.init();
|
io.init();
|
||||||
TERN_(HAS_TOUCH_SLEEP, wakeUp());
|
TERN_(HAS_DISPLAY_SLEEP, wakeUp());
|
||||||
enable();
|
enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +280,7 @@ bool Touch::get_point(int16_t * const x, int16_t * const y) {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_DISPLAY_SLEEP
|
||||||
if (is_touched)
|
if (is_touched)
|
||||||
wakeUp();
|
wakeUp();
|
||||||
else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen())
|
else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen())
|
||||||
@ -288,7 +290,7 @@ bool Touch::get_point(int16_t * const x, int16_t * const y) {
|
|||||||
return is_touched;
|
return is_touched;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_DISPLAY_SLEEP
|
||||||
|
|
||||||
void Touch::sleepTimeout() {
|
void Touch::sleepTimeout() {
|
||||||
#if HAS_LCD_BRIGHTNESS
|
#if HAS_LCD_BRIGHTNESS
|
||||||
@ -308,12 +310,14 @@ bool Touch::get_point(int16_t * const x, int16_t * const y) {
|
|||||||
next_touch_ms = millis() + 100;
|
next_touch_ms = millis() + 100;
|
||||||
safe_delay(20);
|
safe_delay(20);
|
||||||
}
|
}
|
||||||
next_sleep_ms = millis() + MIN_TO_MS(ui.sleep_timeout_minutes);
|
next_sleep_ms = ui.sleep_timeout_minutes ? millis() + MIN_TO_MS(ui.sleep_timeout_minutes) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_TOUCH_SLEEP
|
void MarlinUI::sleep_display(const bool sleep/*=true*/) {
|
||||||
|
if (!sleep) touch.wakeUp();
|
||||||
|
}
|
||||||
|
|
||||||
Touch touch;
|
#endif // HAS_DISPLAY_SLEEP
|
||||||
|
|
||||||
bool MarlinUI::touch_pressed() {
|
bool MarlinUI::touch_pressed() {
|
||||||
return touch.is_clicked();
|
return touch.is_clicked();
|
||||||
|
@ -71,7 +71,6 @@ typedef struct __attribute__((__packed__)) {
|
|||||||
#define UBL_REPEAT_DELAY 125
|
#define UBL_REPEAT_DELAY 125
|
||||||
#define FREE_MOVE_RANGE 32
|
#define FREE_MOVE_RANGE 32
|
||||||
|
|
||||||
#define TSLP_PREINIT 0
|
|
||||||
#define TSLP_SLEEPING 1
|
#define TSLP_SLEEPING 1
|
||||||
|
|
||||||
class Touch {
|
class Touch {
|
||||||
@ -105,7 +104,7 @@ class Touch {
|
|||||||
}
|
}
|
||||||
static void disable() { enabled = false; }
|
static void disable() { enabled = false; }
|
||||||
static void enable() { enabled = true; }
|
static void enable() { enabled = true; }
|
||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_DISPLAY_SLEEP
|
||||||
static millis_t next_sleep_ms;
|
static millis_t next_sleep_ms;
|
||||||
static bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; }
|
static bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; }
|
||||||
static void sleepTimeout();
|
static void sleepTimeout();
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
void MarlinUI::tft_idle() {
|
void MarlinUI::tft_idle() {
|
||||||
#if ENABLED(TOUCH_SCREEN)
|
#if ENABLED(TOUCH_SCREEN)
|
||||||
if (TERN0(HAS_TOUCH_SLEEP, lcd_sleep_task())) return;
|
if (TERN0(HAS_DISPLAY_SLEEP, lcd_sleep_task())) return;
|
||||||
if (draw_menu_navigation) {
|
if (draw_menu_navigation) {
|
||||||
add_control(NAVIGATION_PAGE_UP_X, NAVIGATION_PAGE_UP_Y, PAGE_UP, imgPageUp, encoderTopLine > 0);
|
add_control(NAVIGATION_PAGE_UP_X, NAVIGATION_PAGE_UP_Y, PAGE_UP, imgPageUp, encoderTopLine > 0);
|
||||||
add_control(NAVIGATION_PAGE_DOWN_X, NAVIGATION_PAGE_DOWN_Y, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items);
|
add_control(NAVIGATION_PAGE_DOWN_X, NAVIGATION_PAGE_DOWN_Y, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items);
|
||||||
|
@ -188,7 +188,7 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_TOUCH_SLEEP
|
#if ALL(TOUCH_SCREEN, HAS_DISPLAY_SLEEP)
|
||||||
|
|
||||||
bool lcd_sleep_task() {
|
bool lcd_sleep_task() {
|
||||||
static bool sleepCleared;
|
static bool sleepCleared;
|
||||||
@ -207,7 +207,7 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_TOUCH_SLEEP
|
#endif
|
||||||
|
|
||||||
void text_line(const uint16_t y, uint16_t color) {
|
void text_line(const uint16_t y, uint16_t color) {
|
||||||
tft.canvas(0, y, TFT_WIDTH, MENU_ITEM_HEIGHT);
|
tft.canvas(0, y, TFT_WIDTH, MENU_ITEM_HEIGHT);
|
||||||
|
@ -104,9 +104,9 @@ void disable_steppers();
|
|||||||
#if HAS_EXTRUDERS
|
#if HAS_EXTRUDERS
|
||||||
void e_select();
|
void e_select();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#if HAS_DISPLAY_SLEEP
|
||||||
#if HAS_TOUCH_SLEEP
|
|
||||||
bool lcd_sleep_task();
|
bool lcd_sleep_task();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void draw_heater_status(uint16_t x, uint16_t y, const int8_t heater);
|
void draw_heater_status(uint16_t x, uint16_t y, const int8_t heater);
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#error "Unknown Touch Screen Type."
|
#error "Unknown Touch Screen Type."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_DISPLAY_SLEEP
|
||||||
millis_t TouchButtons::next_sleep_ms;
|
millis_t TouchButtons::next_sleep_ms;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -58,7 +58,9 @@ TouchButtons touchBt;
|
|||||||
|
|
||||||
void TouchButtons::init() {
|
void TouchButtons::init() {
|
||||||
touchIO.init();
|
touchIO.init();
|
||||||
TERN_(HAS_TOUCH_SLEEP, next_sleep_ms = millis() + SEC_TO_MS(ui.sleep_timeout_minutes * 60));
|
#if HAS_DISPLAY_SLEEP
|
||||||
|
next_sleep_ms = ui.sleep_timeout_minutes ? millis() + MIN_TO_MS(ui.sleep_timeout_minutes) : 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TouchButtons::read_buttons() {
|
uint8_t TouchButtons::read_buttons() {
|
||||||
@ -70,10 +72,10 @@ uint8_t TouchButtons::read_buttons() {
|
|||||||
const bool is_touched = TOUCH_PORTRAIT == _TOUCH_ORIENTATION
|
const bool is_touched = TOUCH_PORTRAIT == _TOUCH_ORIENTATION
|
||||||
? touchIO.getRawPoint(&y, &x)
|
? touchIO.getRawPoint(&y, &x)
|
||||||
: touchIO.getRawPoint(&x, &y);
|
: touchIO.getRawPoint(&x, &y);
|
||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_DISPLAY_SLEEP
|
||||||
if (is_touched)
|
if (is_touched)
|
||||||
wakeUp();
|
wakeUp();
|
||||||
else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen())
|
else if (next_sleep_ms && !isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen())
|
||||||
sleepTimeout();
|
sleepTimeout();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -129,7 +131,7 @@ uint8_t TouchButtons::read_buttons() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_DISPLAY_SLEEP
|
||||||
|
|
||||||
void TouchButtons::sleepTimeout() {
|
void TouchButtons::sleepTimeout() {
|
||||||
#if HAS_LCD_BRIGHTNESS
|
#if HAS_LCD_BRIGHTNESS
|
||||||
@ -139,6 +141,7 @@ uint8_t TouchButtons::read_buttons() {
|
|||||||
#endif
|
#endif
|
||||||
next_sleep_ms = TSLP_SLEEPING;
|
next_sleep_ms = TSLP_SLEEPING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TouchButtons::wakeUp() {
|
void TouchButtons::wakeUp() {
|
||||||
if (isSleeping()) {
|
if (isSleeping()) {
|
||||||
#if HAS_LCD_BRIGHTNESS
|
#if HAS_LCD_BRIGHTNESS
|
||||||
@ -147,9 +150,13 @@ uint8_t TouchButtons::read_buttons() {
|
|||||||
WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
next_sleep_ms = millis() + MIN_TO_MS(ui.sleep_timeout_minutes);
|
next_sleep_ms = ui.sleep_timeout_minutes ? millis() + MIN_TO_MS(ui.sleep_timeout_minutes) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_TOUCH_SLEEP
|
void MarlinUI::sleep_display(const bool sleep/*=true*/) {
|
||||||
|
if (!sleep) touchBt.wakeUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // HAS_DISPLAY_SLEEP
|
||||||
|
|
||||||
#endif // HAS_TOUCH_BUTTONS
|
#endif // HAS_TOUCH_BUTTONS
|
||||||
|
@ -53,14 +53,13 @@
|
|||||||
#define BUTTON_Y_HI (TFT_HEIGHT) - BUTTON_SPACING
|
#define BUTTON_Y_HI (TFT_HEIGHT) - BUTTON_SPACING
|
||||||
#define BUTTON_Y_LO BUTTON_Y_HI - BUTTON_HEIGHT
|
#define BUTTON_Y_LO BUTTON_Y_HI - BUTTON_HEIGHT
|
||||||
|
|
||||||
#define TSLP_PREINIT 0
|
|
||||||
#define TSLP_SLEEPING 1
|
#define TSLP_SLEEPING 1
|
||||||
|
|
||||||
class TouchButtons {
|
class TouchButtons {
|
||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
static uint8_t read_buttons();
|
static uint8_t read_buttons();
|
||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_DISPLAY_SLEEP
|
||||||
static millis_t next_sleep_ms;
|
static millis_t next_sleep_ms;
|
||||||
static bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; }
|
static bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; }
|
||||||
static void sleepTimeout();
|
static void sleepTimeout();
|
||||||
|
@ -3468,7 +3468,7 @@ void MarlinSettings::reset() {
|
|||||||
#if HAS_BACKLIGHT_TIMEOUT
|
#if HAS_BACKLIGHT_TIMEOUT
|
||||||
ui.backlight_timeout_minutes = LCD_BACKLIGHT_TIMEOUT_MINS;
|
ui.backlight_timeout_minutes = LCD_BACKLIGHT_TIMEOUT_MINS;
|
||||||
#elif HAS_DISPLAY_SLEEP
|
#elif HAS_DISPLAY_SLEEP
|
||||||
ui.sleep_timeout_minutes = TERN(TOUCH_SCREEN, TOUCH_IDLE_SLEEP_MINS, DISPLAY_SLEEP_MINUTES);
|
ui.sleep_timeout_minutes = DISPLAY_SLEEP_MINUTES;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -854,11 +854,11 @@ volatile bool Temperature::raw_temps_ready = false;
|
|||||||
#endif
|
#endif
|
||||||
} // every 2 seconds
|
} // every 2 seconds
|
||||||
|
|
||||||
// Timeout after MAX_CYCLE_TIME_PID_AUTOTUNE minutes since the last undershoot/overshoot cycle
|
// Timeout after PID_AUTOTUNE_MAX_CYCLE_MINS minutes since the last undershoot/overshoot cycle
|
||||||
#ifndef MAX_CYCLE_TIME_PID_AUTOTUNE
|
#ifndef PID_AUTOTUNE_MAX_CYCLE_MINS
|
||||||
#define MAX_CYCLE_TIME_PID_AUTOTUNE 20L
|
#define PID_AUTOTUNE_MAX_CYCLE_MINS 20L
|
||||||
#endif
|
#endif
|
||||||
if ((ms - _MIN(t1, t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) {
|
if ((ms - _MIN(t1, t2)) > MIN_TO_MS(PID_AUTOTUNE_MAX_CYCLE_MINS)) {
|
||||||
TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0));
|
TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0));
|
||||||
TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_TUNING_TIMEOUT));
|
TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_TUNING_TIMEOUT));
|
||||||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT));
|
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user