ultralcd.h 7.9 KB

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