ultralcd.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. #ifndef ULTRALCD_H
  2. #define ULTRALCD_H
  3. #include "mesh_bed_calibration.h"
  4. #include "config.h"
  5. extern void menu_lcd_longpress_func(void);
  6. extern void menu_lcd_charsetup_func(void);
  7. extern void menu_lcd_lcdupdate_func(void);
  8. // Call with a false parameter to suppress the LCD update from various places like the planner or the temp control.
  9. void ultralcd_init();
  10. void lcd_setstatus(const char* message);
  11. void lcd_setstatuspgm(const char* message);
  12. //! return to the main status screen and display the alert message
  13. //! Beware - it has sideeffects:
  14. //! - always returns the display to the main status screen
  15. //! - always makes lcd_reset (which is slow and causes flicker)
  16. //! - does not update the message if there is already one (i.e. lcd_status_message_level > 0)
  17. void lcd_setalertstatus(const char* message);
  18. void lcd_setalertstatuspgm(const char* message);
  19. //! only update the alert message on the main status screen
  20. //! has no sideeffects, may be called multiple times
  21. void lcd_updatestatus(const char *message);
  22. void lcd_updatestatuspgm(const char *message);
  23. void lcd_reset_alert_level();
  24. uint8_t get_message_level();
  25. void lcd_adjust_z();
  26. void lcd_pick_babystep();
  27. void lcd_alright();
  28. void show_preheat_nozzle_warning();
  29. void EEPROM_save_B(int pos, int* value);
  30. void EEPROM_read_B(int pos, int* value);
  31. void lcd_wait_interact();
  32. void lcd_loading_filament();
  33. void lcd_change_success();
  34. void lcd_loading_color();
  35. void lcd_sdcard_stop();
  36. void lcd_pause_print();
  37. void lcd_pause_usb_print();
  38. void lcd_resume_print();
  39. void lcd_print_stop();
  40. void prusa_statistics(uint8_t _message, uint8_t _col_nr = 0);
  41. unsigned char lcd_choose_color();
  42. void lcd_load_filament_color_check();
  43. //void lcd_mylang();
  44. extern void lcd_belttest();
  45. extern bool lcd_selftest();
  46. void lcd_menu_statistics();
  47. void lcd_status_screen(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
  48. void lcd_menu_extruder_info(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
  49. void lcd_menu_show_sensors_state(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
  50. #ifdef TMC2130
  51. bool lcd_crash_detect_enabled();
  52. void lcd_crash_detect_enable();
  53. void lcd_crash_detect_disable();
  54. #endif
  55. extern const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines);
  56. extern const char* lcd_display_message_fullscreen_P(const char *msg);
  57. extern void lcd_return_to_status();
  58. extern void lcd_wait_for_click();
  59. extern bool lcd_wait_for_click_delay(uint16_t nDelay);
  60. extern void lcd_show_fullscreen_message_and_wait_P(const char *msg);
  61. // 0: no, 1: yes, -1: timeouted
  62. extern int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, bool default_yes = false);
  63. extern int8_t lcd_show_multiscreen_message_two_choices_and_wait_P(const char *msg, bool allow_timeouting, bool default_yes,
  64. const char *first_choice, const char *second_choice);
  65. extern int8_t lcd_show_multiscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, bool default_yes = false);
  66. // Ask the user to move the Z axis up to the end stoppers and let
  67. // the user confirm that it has been done.
  68. #ifndef TMC2130
  69. extern bool lcd_calibrate_z_end_stop_manual(bool only_z);
  70. #endif
  71. // Show the result of the calibration process on the LCD screen.
  72. extern void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask);
  73. extern void lcd_diag_show_end_stops();
  74. #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
  75. #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
  76. #define LCD_MESSAGERPGM(x) lcd_setstatuspgm((x))
  77. #define LCD_ALERTMESSAGERPGM(x) lcd_setalertstatuspgm((x))
  78. // To be used in lcd_commands_type.
  79. enum class LcdCommands : uint_least8_t
  80. {
  81. Idle,
  82. LoadFilament,
  83. StopPrint,
  84. FarmModeConfirm,
  85. LongPause,
  86. PidExtruder,
  87. Layer1Cal,
  88. };
  89. extern LcdCommands lcd_commands_type;
  90. extern int8_t FSensorStateMenu;
  91. enum class CustomMsg : uint_least8_t
  92. {
  93. Status, //!< status message from lcd_status_message variable
  94. MeshBedLeveling, //!< Mesh bed leveling in progress
  95. FilamentLoading, //!< Loading filament in progress
  96. PidCal, //!< PID tuning in progress
  97. TempCal, //!< PINDA temperature calibration
  98. TempCompPreheat, //!< Temperature compensation preheat
  99. M0Wait, //!< M0/M1 Wait command working even from SD
  100. MsgUpdate, //!< Short message even while printing from SD
  101. Resuming, //!< Resuming message
  102. };
  103. extern CustomMsg custom_message_type;
  104. extern unsigned int custom_message_state;
  105. extern uint8_t farm_mode;
  106. extern int farm_timer;
  107. extern uint8_t farm_status;
  108. extern bool UserECoolEnabled();
  109. extern bool FarmOrUserECool();
  110. #ifdef TMC2130
  111. #define SILENT_MODE_NORMAL 0
  112. #define SILENT_MODE_STEALTH 1
  113. #define SILENT_MODE_OFF SILENT_MODE_NORMAL
  114. #else
  115. #define SILENT_MODE_POWER 0
  116. #define SILENT_MODE_SILENT 1
  117. #define SILENT_MODE_AUTO 2
  118. #define SILENT_MODE_OFF SILENT_MODE_POWER
  119. #endif
  120. #ifdef IR_SENSOR_ANALOG
  121. extern bool bMenuFSDetect;
  122. void printf_IRSensorAnalogBoardChange();
  123. #endif //IR_SENSOR_ANALOG
  124. extern int8_t SilentModeMenu;
  125. extern uint8_t SilentModeMenu_MMU;
  126. extern bool cancel_heatup;
  127. extern bool isPrintPaused;
  128. extern uint8_t scrollstuff;
  129. void lcd_ignore_click(bool b=true);
  130. void lcd_commands();
  131. extern bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function
  132. void lcd_hw_setup_menu(void); // NOT static due to using inside "util" module ("nozzle_diameter_check()")
  133. void change_extr(int extr);
  134. #ifdef SNMM
  135. void extr_unload_all();
  136. void extr_unload_used();
  137. #endif //SNMM
  138. void extr_unload();
  139. enum class FilamentAction : uint_least8_t
  140. {
  141. None, //!< 'none' state is used as flag for (filament) autoLoad (i.e. opposite for 'autoLoad' state)
  142. Load,
  143. AutoLoad,
  144. UnLoad,
  145. MmuLoad,
  146. MmuUnLoad,
  147. MmuEject,
  148. MmuCut,
  149. Preheat,
  150. Lay1Cal,
  151. };
  152. extern FilamentAction eFilamentAction;
  153. extern bool bFilamentFirstRun;
  154. extern bool bFilamentPreheatState;
  155. extern bool bFilamentAction;
  156. void mFilamentItem(uint16_t nTemp,uint16_t nTempBed);
  157. void mFilamentItemForce();
  158. void lcd_generic_preheat_menu();
  159. void unload_filament(bool automatic = false);
  160. void lcd_printer_connected();
  161. void lcd_ping();
  162. void lcd_calibrate_extruder();
  163. void lcd_wait_for_heater();
  164. void lcd_wait_for_cool_down();
  165. void lcd_move_e(); // NOT static due to usage in Marlin_main
  166. void lcd_extr_cal_reset();
  167. void lcd_temp_cal_show_result(bool result);
  168. #ifdef PINDA_THERMISTOR
  169. bool lcd_wait_for_pinda(float temp);
  170. #endif //PINDA_THERMISTOR
  171. void bowden_menu();
  172. char reset_menu();
  173. uint8_t choose_menu_P(const char *header, const char *item, const char *last_item = nullptr);
  174. void lcd_pinda_calibration_menu();
  175. void lcd_calibrate_pinda();
  176. void lcd_temp_calibration_set();
  177. void display_loading();
  178. void lcd_set_degree();
  179. #if (LANG_MODE != 0)
  180. void lcd_language();
  181. #endif
  182. void lcd_wizard();
  183. bool lcd_autoDepleteEnabled();
  184. //! @brief Wizard state
  185. enum class WizState : uint8_t
  186. {
  187. Run, //!< run wizard? Main entry point.
  188. Restore, //!< restore calibration status
  189. Selftest, //!< self test
  190. Xyz, //!< xyz calibration
  191. Z, //!< z calibration
  192. IsFil, //!< Is filament loaded? First step of 1st layer calibration
  193. PreheatPla, //!< waiting for preheat nozzle for PLA
  194. Preheat, //!< Preheat for any material
  195. LoadFilCold, //!< Load filament for MMU
  196. LoadFilHot, //!< Load filament without MMU
  197. IsPla, //!< Is PLA filament?
  198. Lay1CalCold, //!< First layer calibration, temperature not selected yet
  199. Lay1CalHot, //!< First layer calibration, temperature already selected
  200. RepeatLay1Cal, //!< Repeat first layer calibration?
  201. Finish, //!< Deactivate wizard
  202. };
  203. void lcd_wizard(WizState state);
  204. extern void lcd_experimental_toggle();
  205. extern void lcd_experimental_menu();
  206. #ifdef PINDA_TEMP_COMP
  207. extern void lcd_pinda_temp_compensation_toggle();
  208. #endif //PINDA_TEMP_COMP
  209. #endif //ULTRALCD_H