My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

marlinui.h 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #include "../inc/MarlinConfig.h"
  24. #include "../module/motion.h"
  25. #include "buttons.h"
  26. #if HAS_BUZZER
  27. #include "../libs/buzzer.h"
  28. #endif
  29. #if ENABLED(SDSUPPORT)
  30. #include "../sd/cardreader.h"
  31. #endif
  32. #if ENABLED(TOUCH_SCREEN_CALIBRATION)
  33. #include "tft_io/touch_calibration.h"
  34. #endif
  35. #if EITHER(HAS_LCD_MENU, ULTIPANEL_FEEDMULTIPLY)
  36. #define HAS_ENCODER_ACTION 1
  37. #endif
  38. #if E_MANUAL > 1
  39. #define MULTI_MANUAL 1
  40. #endif
  41. #if HAS_DISPLAY
  42. #include "../module/printcounter.h"
  43. #endif
  44. #if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE)
  45. #include "../feature/pause.h"
  46. #include "../module/motion.h" // for active_extruder
  47. #endif
  48. #if HAS_WIRED_LCD
  49. enum LCDViewAction : uint8_t {
  50. LCDVIEW_NONE,
  51. LCDVIEW_REDRAW_NOW,
  52. LCDVIEW_CALL_REDRAW_NEXT,
  53. LCDVIEW_CLEAR_CALL_REDRAW,
  54. LCDVIEW_CALL_NO_REDRAW
  55. };
  56. #if HAS_ADC_BUTTONS
  57. uint8_t get_ADC_keyValue();
  58. #endif
  59. #define LCD_UPDATE_INTERVAL TERN(HAS_TOUCH_BUTTONS, 50, 100)
  60. #if HAS_LCD_MENU
  61. #include "lcdprint.h"
  62. #if !HAS_GRAPHICAL_TFT
  63. void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false);
  64. inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); }
  65. inline void wrap_string(uint8_t &col, uint8_t &row, const char * const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); }
  66. #endif
  67. typedef void (*screenFunc_t)();
  68. typedef void (*menuAction_t)();
  69. #if ENABLED(AUTO_BED_LEVELING_UBL)
  70. void lcd_mesh_edit_setup(const float &initial);
  71. float lcd_mesh_edit();
  72. #endif
  73. #endif // HAS_LCD_MENU
  74. #endif // HAS_WIRED_LCD
  75. #if HAS_MARLINUI_U8GLIB
  76. enum MarlinFont : uint8_t {
  77. FONT_STATUSMENU = 1,
  78. FONT_EDIT,
  79. FONT_MENU
  80. };
  81. #else
  82. enum HD44780CharSet : uint8_t {
  83. CHARSET_MENU,
  84. CHARSET_INFO,
  85. CHARSET_BOOT
  86. };
  87. #endif
  88. #if PREHEAT_COUNT
  89. typedef struct {
  90. TERN_(HAS_HOTEND, celsius_t hotend_temp);
  91. TERN_(HAS_HEATED_BED, celsius_t bed_temp );
  92. TERN_(HAS_FAN, uint16_t fan_speed );
  93. } preheat_t;
  94. #endif
  95. #if HAS_LCD_MENU
  96. // Manual Movement class
  97. class ManualMove {
  98. private:
  99. static AxisEnum axis;
  100. #if MULTI_MANUAL
  101. static int8_t e_index;
  102. #else
  103. static int8_t constexpr e_index = 0;
  104. #endif
  105. static millis_t start_time;
  106. TERN_(IS_KINEMATIC, static xyze_pos_t all_axes_destination);
  107. public:
  108. static float menu_scale;
  109. TERN_(IS_KINEMATIC, static float offset);
  110. template <typename T>
  111. void set_destination(const T& dest) {
  112. #if IS_KINEMATIC
  113. // Moves are segmented, so the entire move is not submitted at once.
  114. // Using a separate variable prevents corrupting the in-progress move.
  115. all_axes_destination = current_position;
  116. all_axes_destination.set(dest);
  117. #else
  118. // Moves are submitted as single line to the planner using buffer_line.
  119. current_position.set(dest);
  120. #endif
  121. }
  122. #if IS_KINEMATIC
  123. static bool processing;
  124. #else
  125. static bool constexpr processing = false;
  126. #endif
  127. static void task();
  128. static void soon(AxisEnum axis
  129. #if MULTI_MANUAL
  130. , const int8_t eindex=-1
  131. #endif
  132. );
  133. };
  134. #endif
  135. ////////////////////////////////////////////
  136. //////////// MarlinUI Singleton ////////////
  137. ////////////////////////////////////////////
  138. class MarlinUI {
  139. public:
  140. MarlinUI() {
  141. TERN_(HAS_LCD_MENU, currentScreen = status_screen);
  142. }
  143. #if HAS_MULTI_LANGUAGE
  144. static uint8_t language;
  145. static inline void set_language(const uint8_t lang) {
  146. if (lang < NUM_LANGUAGES) {
  147. language = lang;
  148. return_to_status();
  149. refresh();
  150. }
  151. }
  152. #endif
  153. #if ENABLED(SOUND_MENU_ITEM)
  154. static bool buzzer_enabled; // Initialized by settings.load()
  155. #else
  156. static constexpr bool buzzer_enabled = true;
  157. #endif
  158. #if HAS_BUZZER
  159. static void buzz(const long duration, const uint16_t freq);
  160. #endif
  161. FORCE_INLINE static void chirp() {
  162. TERN_(HAS_CHIRP, buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ));
  163. }
  164. #if ENABLED(LCD_HAS_STATUS_INDICATORS)
  165. static void update_indicators();
  166. #endif
  167. // LCD implementations
  168. static void clear_lcd();
  169. #if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION)
  170. static void check_touch_calibration() {
  171. if (touch_calibration.need_calibration()) currentScreen = touch_calibration_screen;
  172. }
  173. #endif
  174. #if ENABLED(SDSUPPORT)
  175. #define MEDIA_MENU_GATEWAY TERN(PASSWORD_ON_SD_PRINT_MENU, password.media_gatekeeper, menu_media)
  176. static void media_changed(const uint8_t old_stat, const uint8_t stat);
  177. #endif
  178. #if ENABLED(DWIN_CREALITY_LCD)
  179. static void refresh();
  180. #else
  181. FORCE_INLINE static void refresh() {
  182. TERN_(HAS_WIRED_LCD, refresh(LCDVIEW_CLEAR_CALL_REDRAW));
  183. }
  184. #endif
  185. #if HAS_WIRED_LCD
  186. static bool detected();
  187. static void init_lcd();
  188. #else
  189. static inline bool detected() { return true; }
  190. static inline void init_lcd() {}
  191. #endif
  192. #if HAS_PRINT_PROGRESS
  193. #if HAS_PRINT_PROGRESS_PERMYRIAD
  194. typedef uint16_t progress_t;
  195. #define PROGRESS_SCALE 100U
  196. #define PROGRESS_MASK 0x7FFF
  197. #else
  198. typedef uint8_t progress_t;
  199. #define PROGRESS_SCALE 1U
  200. #define PROGRESS_MASK 0x7F
  201. #endif
  202. #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
  203. static progress_t progress_override;
  204. static void set_progress(const progress_t p) { progress_override = _MIN(p, 100U * (PROGRESS_SCALE)); }
  205. static void set_progress_done() { progress_override = (PROGRESS_MASK + 1U) + 100U * (PROGRESS_SCALE); }
  206. static void progress_reset() { if (progress_override & (PROGRESS_MASK + 1U)) set_progress(0); }
  207. #if ENABLED(SHOW_REMAINING_TIME)
  208. static inline uint32_t _calculated_remaining_time() {
  209. const duration_t elapsed = print_job_timer.duration();
  210. const progress_t progress = _get_progress();
  211. return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0;
  212. }
  213. #if ENABLED(USE_M73_REMAINING_TIME)
  214. static uint32_t remaining_time;
  215. FORCE_INLINE static void set_remaining_time(const uint32_t r) { remaining_time = r; }
  216. FORCE_INLINE static uint32_t get_remaining_time() { return remaining_time ?: _calculated_remaining_time(); }
  217. FORCE_INLINE static void reset_remaining_time() { set_remaining_time(0); }
  218. #else
  219. FORCE_INLINE static uint32_t get_remaining_time() { return _calculated_remaining_time(); }
  220. #endif
  221. #endif
  222. #endif
  223. static progress_t _get_progress();
  224. #if HAS_PRINT_PROGRESS_PERMYRIAD
  225. FORCE_INLINE static uint16_t get_progress_permyriad() { return _get_progress(); }
  226. #endif
  227. static uint8_t get_progress_percent() { return uint8_t(_get_progress() / (PROGRESS_SCALE)); }
  228. #else
  229. static constexpr uint8_t get_progress_percent() { return 0; }
  230. #endif
  231. #if HAS_STATUS_MESSAGE
  232. static char status_message[];
  233. static uint8_t alert_level; // Higher levels block lower levels
  234. #if ENABLED(STATUS_MESSAGE_SCROLLING)
  235. static uint8_t status_scroll_offset;
  236. static void advance_status_scroll();
  237. static char* status_and_len(uint8_t &len);
  238. #endif
  239. static bool has_status();
  240. static void reset_status(const bool no_welcome=false);
  241. static void set_status(const char* const message, const bool persist=false);
  242. static void set_status_P(PGM_P const message, const int8_t level=0);
  243. static void status_printf_P(const uint8_t level, PGM_P const fmt, ...);
  244. static void set_alert_status_P(PGM_P const message);
  245. static inline void reset_alert_level() { alert_level = 0; }
  246. #else
  247. static constexpr bool has_status() { return false; }
  248. static inline void reset_status(const bool=false) {}
  249. static void set_status(const char* message, const bool=false);
  250. static void set_status_P(PGM_P message, const int8_t=0);
  251. static void status_printf_P(const uint8_t, PGM_P message, ...);
  252. static inline void set_alert_status_P(PGM_P const) {}
  253. static inline void reset_alert_level() {}
  254. #endif
  255. #if HAS_DISPLAY
  256. static void init();
  257. static void update();
  258. static void abort_print();
  259. static void pause_print();
  260. static void resume_print();
  261. #if HAS_WIRED_LCD
  262. static millis_t next_button_update_ms;
  263. static LCDViewAction lcdDrawUpdate;
  264. FORCE_INLINE static bool should_draw() { return bool(lcdDrawUpdate); }
  265. FORCE_INLINE static void refresh(const LCDViewAction type) { lcdDrawUpdate = type; }
  266. #if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
  267. static void draw_custom_bootscreen(const uint8_t frame=0);
  268. static void show_custom_bootscreen();
  269. #endif
  270. #if ENABLED(SHOW_BOOTSCREEN)
  271. #ifndef BOOTSCREEN_TIMEOUT
  272. #define BOOTSCREEN_TIMEOUT 2500
  273. #endif
  274. static void draw_marlin_bootscreen(const bool line2=false);
  275. static void show_marlin_bootscreen();
  276. static void show_bootscreen();
  277. #endif
  278. #if HAS_MARLINUI_U8GLIB
  279. static void set_font(const MarlinFont font_nr);
  280. #else
  281. static void set_custom_characters(const HD44780CharSet screen_charset=CHARSET_INFO);
  282. #if ENABLED(LCD_PROGRESS_BAR)
  283. static millis_t progress_bar_ms; // Start time for the current progress bar cycle
  284. static void draw_progress_bar(const uint8_t percent);
  285. #if PROGRESS_MSG_EXPIRE > 0
  286. static millis_t expire_status_ms; // = 0
  287. FORCE_INLINE static void reset_progress_bar_timeout() { expire_status_ms = 0; }
  288. #endif
  289. #endif
  290. #endif
  291. static uint8_t lcd_status_update_delay;
  292. #if HAS_LCD_CONTRAST
  293. static int16_t contrast;
  294. static void set_contrast(const int16_t value);
  295. FORCE_INLINE static void refresh_contrast() { set_contrast(contrast); }
  296. #endif
  297. #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
  298. static millis_t next_filament_display;
  299. #endif
  300. static void quick_feedback(const bool clear_buttons=true);
  301. #if HAS_BUZZER
  302. static void completion_feedback(const bool good=true);
  303. #else
  304. static inline void completion_feedback(const bool=true) {}
  305. #endif
  306. #if DISABLED(LIGHTWEIGHT_UI)
  307. static void draw_status_message(const bool blink);
  308. #endif
  309. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  310. static void draw_hotend_status(const uint8_t row, const uint8_t extruder);
  311. #endif
  312. #if HAS_TOUCH_BUTTONS
  313. static bool on_edit_screen;
  314. static void screen_click(const uint8_t row, const uint8_t col, const uint8_t x, const uint8_t y);
  315. #endif
  316. static void status_screen();
  317. #endif
  318. #if HAS_MARLINUI_U8GLIB
  319. static bool drawing_screen, first_page;
  320. #else
  321. static constexpr bool drawing_screen = false, first_page = true;
  322. #endif
  323. static bool get_blink();
  324. static void kill_screen(PGM_P const lcd_error, PGM_P const lcd_component);
  325. static void draw_kill_screen();
  326. #else // No LCD
  327. static inline void init() {}
  328. static inline void update() {}
  329. static inline void return_to_status() {}
  330. #endif
  331. #if ENABLED(SDSUPPORT)
  332. #if BOTH(SCROLL_LONG_FILENAMES, HAS_LCD_MENU)
  333. #define MARLINUI_SCROLL_NAME 1
  334. #endif
  335. #if MARLINUI_SCROLL_NAME
  336. static uint8_t filename_scroll_pos, filename_scroll_max;
  337. #endif
  338. static const char * scrolled_filename(CardReader &theCard, const uint8_t maxlen, uint8_t hash, const bool doScroll);
  339. #endif
  340. #if PREHEAT_COUNT
  341. static preheat_t material_preset[PREHEAT_COUNT];
  342. static PGM_P get_preheat_label(const uint8_t m);
  343. #endif
  344. #if HAS_LCD_MENU
  345. #if LCD_TIMEOUT_TO_STATUS
  346. static millis_t return_to_status_ms;
  347. #endif
  348. #if HAS_TOUCH_BUTTONS
  349. static uint8_t touch_buttons;
  350. static uint8_t repeat_delay;
  351. #else
  352. static constexpr uint8_t touch_buttons = 0;
  353. #endif
  354. #if ENABLED(ENCODER_RATE_MULTIPLIER)
  355. static bool encoderRateMultiplierEnabled;
  356. static millis_t lastEncoderMovementMillis;
  357. static void enable_encoder_multiplier(const bool onoff);
  358. #define ENCODER_RATE_MULTIPLY(F) (ui.encoderRateMultiplierEnabled = F)
  359. #else
  360. #define ENCODER_RATE_MULTIPLY(F) NOOP
  361. #endif
  362. // Manual Movement
  363. static ManualMove manual_move;
  364. // Select Screen (modal NO/YES style dialog)
  365. static bool selection;
  366. static void set_selection(const bool sel) { selection = sel; }
  367. static bool update_selection();
  368. static bool lcd_clicked;
  369. static bool use_click();
  370. static void synchronize(PGM_P const msg=nullptr);
  371. static screenFunc_t currentScreen;
  372. static bool screen_changed;
  373. static void goto_screen(const screenFunc_t screen, const uint16_t encoder=0, const uint8_t top=0, const uint8_t items=0);
  374. static void save_previous_screen();
  375. // goto_previous_screen and go_back may also be used as menu item callbacks
  376. static void _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_back));
  377. static inline void goto_previous_screen() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, false)); }
  378. static inline void go_back() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, true)); }
  379. static void return_to_status();
  380. static inline bool on_status_screen() { return currentScreen == status_screen; }
  381. FORCE_INLINE static void run_current_screen() { (*currentScreen)(); }
  382. #if ENABLED(LIGHTWEIGHT_UI)
  383. static void lcd_in_status(const bool inStatus);
  384. #endif
  385. FORCE_INLINE static void defer_status_screen(const bool defer=true) {
  386. #if LCD_TIMEOUT_TO_STATUS > 0
  387. defer_return_to_status = defer;
  388. #else
  389. UNUSED(defer);
  390. #endif
  391. }
  392. static inline void goto_previous_screen_no_defer() {
  393. defer_status_screen(false);
  394. goto_previous_screen();
  395. }
  396. #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
  397. static void reselect_last_file();
  398. #endif
  399. #if ENABLED(AUTO_BED_LEVELING_UBL)
  400. static void ubl_plot(const uint8_t x_plot, const uint8_t y_plot);
  401. #endif
  402. static void draw_select_screen_prompt(PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr);
  403. #elif HAS_WIRED_LCD
  404. static constexpr bool lcd_clicked = false;
  405. static constexpr bool on_status_screen() { return true; }
  406. FORCE_INLINE static void run_current_screen() { status_screen(); }
  407. #endif
  408. #if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE)
  409. static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder);
  410. #else
  411. static inline void _pause_show_message() {}
  412. #define pause_show_message(...) _pause_show_message()
  413. #endif
  414. //
  415. // EEPROM: Reset / Init / Load / Store
  416. //
  417. #if HAS_LCD_MENU
  418. static void reset_settings();
  419. #endif
  420. #if ENABLED(EEPROM_SETTINGS)
  421. #if HAS_LCD_MENU
  422. static void init_eeprom();
  423. static void load_settings();
  424. static void store_settings();
  425. #endif
  426. #if DISABLED(EEPROM_AUTO_INIT)
  427. static void eeprom_alert(const uint8_t msgid);
  428. static inline void eeprom_alert_crc() { eeprom_alert(0); }
  429. static inline void eeprom_alert_index() { eeprom_alert(1); }
  430. static inline void eeprom_alert_version() { eeprom_alert(2); }
  431. #endif
  432. #endif
  433. //
  434. // Special handling if a move is underway
  435. //
  436. #if ANY(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION, PROBE_OFFSET_WIZARD) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING))
  437. #define LCD_HAS_WAIT_FOR_MOVE 1
  438. static bool wait_for_move;
  439. #else
  440. static constexpr bool wait_for_move = false;
  441. #endif
  442. //
  443. // Block interaction while under external control
  444. //
  445. #if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
  446. static bool external_control;
  447. FORCE_INLINE static void capture() { external_control = true; }
  448. FORCE_INLINE static void release() { external_control = false; }
  449. #if ENABLED(AUTO_BED_LEVELING_UBL)
  450. static void external_encoder();
  451. #endif
  452. #else
  453. static constexpr bool external_control = false;
  454. #endif
  455. #if HAS_ENCODER_ACTION
  456. static volatile uint8_t buttons;
  457. #if IS_RRW_KEYPAD
  458. static volatile uint8_t keypad_buttons;
  459. static bool handle_keypad();
  460. #endif
  461. #if HAS_SLOW_BUTTONS
  462. static volatile uint8_t slow_buttons;
  463. static uint8_t read_slow_buttons();
  464. #endif
  465. static void update_buttons();
  466. static inline bool button_pressed() { return BUTTON_CLICK() || TERN(TOUCH_SCREEN, touch_pressed(), false); }
  467. #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
  468. static void wait_for_release();
  469. #endif
  470. static uint32_t encoderPosition;
  471. #define ENCODERBASE (TERN(REVERSE_ENCODER_DIRECTION, -1, +1))
  472. #if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION)
  473. static int8_t encoderDirection;
  474. #else
  475. static constexpr int8_t encoderDirection = ENCODERBASE;
  476. #endif
  477. FORCE_INLINE static void encoder_direction_normal() {
  478. #if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION)
  479. encoderDirection = ENCODERBASE;
  480. #endif
  481. }
  482. FORCE_INLINE static void encoder_direction_menus() {
  483. TERN_(REVERSE_MENU_DIRECTION, encoderDirection = -(ENCODERBASE));
  484. }
  485. FORCE_INLINE static void encoder_direction_select() {
  486. TERN_(REVERSE_SELECT_DIRECTION, encoderDirection = -(ENCODERBASE));
  487. }
  488. #else
  489. static inline void update_buttons() {}
  490. #endif
  491. #if ENABLED(TOUCH_SCREEN_CALIBRATION)
  492. static void touch_calibration_screen();
  493. #endif
  494. #if HAS_GRAPHICAL_TFT
  495. static void move_axis_screen();
  496. #endif
  497. private:
  498. #if HAS_STATUS_MESSAGE
  499. static void finish_status(const bool persist);
  500. #endif
  501. #if HAS_WIRED_LCD
  502. #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0
  503. static bool defer_return_to_status;
  504. #else
  505. static constexpr bool defer_return_to_status = false;
  506. #endif
  507. static void draw_status_screen();
  508. #if HAS_GRAPHICAL_TFT
  509. static void tft_idle();
  510. #if ENABLED(TOUCH_SCREEN)
  511. static bool touch_pressed();
  512. #endif
  513. #endif
  514. #endif
  515. };
  516. extern MarlinUI ui;
  517. #define LCD_MESSAGEPGM_P(x) ui.set_status_P(x)
  518. #define LCD_ALERTMESSAGEPGM_P(x) ui.set_alert_status_P(x)
  519. #define LCD_MESSAGEPGM(x) LCD_MESSAGEPGM_P(GET_TEXT(x))
  520. #define LCD_ALERTMESSAGEPGM(x) LCD_ALERTMESSAGEPGM_P(GET_TEXT(x))