ultralcd.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. #ifndef ULTRALCD_H
  2. #define ULTRALCD_H
  3. #include "Marlin.h"
  4. #include "lcd.h"
  5. #include "conv2str.h"
  6. extern int lcd_puts_P(const char* str);
  7. extern int lcd_printf_P(const char* format, ...);
  8. extern void menu_lcd_longpress_func(void);
  9. extern void menu_lcd_charsetup_func(void);
  10. extern void menu_lcd_lcdupdate_func(void);
  11. static void lcd_language_menu();
  12. // Call with a false parameter to suppress the LCD update from various places like the planner or the temp control.
  13. void ultralcd_init();
  14. void lcd_setstatus(const char* message);
  15. void lcd_setstatuspgm(const char* message);
  16. void lcd_setalertstatuspgm(const char* message);
  17. void lcd_reset_alert_level();
  18. uint8_t get_message_level();
  19. void lcd_adjust_z();
  20. void lcd_pick_babystep();
  21. void lcd_alright();
  22. void EEPROM_save_B(int pos, int* value);
  23. void EEPROM_read_B(int pos, int* value);
  24. void lcd_wait_interact();
  25. void lcd_change_filament();
  26. void lcd_loading_filament();
  27. void lcd_change_success();
  28. void lcd_loading_color();
  29. void lcd_sdcard_stop();
  30. void lcd_sdcard_pause();
  31. void lcd_print_stop();
  32. void prusa_statistics(int _message, uint8_t _col_nr = 0);
  33. void lcd_confirm_print();
  34. unsigned char lcd_choose_color();
  35. //void lcd_mylang();
  36. static void lcd_selftest_v();
  37. extern bool lcd_selftest();
  38. static bool lcd_selfcheck_endstops();
  39. #ifdef TMC2130
  40. static void reset_crash_det(char axis);
  41. static bool lcd_selfcheck_axis_sg(char axis);
  42. static bool lcd_selfcheck_axis(int _axis, int _travel);
  43. #else
  44. static bool lcd_selfcheck_endstops();
  45. static bool lcd_selfcheck_axis(int _axis, int _travel);
  46. static bool lcd_selfcheck_pulleys(int axis);
  47. #endif //TMC2130
  48. static bool lcd_selfcheck_check_heater(bool _isbed);
  49. static int lcd_selftest_screen(int _step, int _progress, int _progress_scale, bool _clear, int _delay);
  50. static void lcd_selftest_screen_step(int _row, int _col, int _state, const char *_name, const char *_indicator);
  51. static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite);
  52. static bool lcd_selftest_fan_dialog(int _fan);
  53. static bool lcd_selftest_fsensor();
  54. static void lcd_selftest_error(int _error_no, const char *_error_1, const char *_error_2);
  55. void lcd_menu_statistics();
  56. extern const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines);
  57. inline const char* lcd_display_message_fullscreen_P(const char *msg)
  58. { uint8_t nlines; return lcd_display_message_fullscreen_P(msg, nlines); }
  59. extern void lcd_wait_for_click();
  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_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(uint8_t result, uint8_t point_too_far_mask);
  71. extern void lcd_diag_show_end_stops();
  72. static unsigned char blink = 0; // Variable for visualization of fan rotation in GLCD
  73. #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
  74. #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
  75. #define LCD_MESSAGERPGM(x) lcd_setstatuspgm((x))
  76. #define LCD_ALERTMESSAGERPGM(x) lcd_setalertstatuspgm((x))
  77. // To be used in lcd_commands_type.
  78. #define LCD_COMMAND_IDLE 0
  79. #define LCD_COMMAND_LOAD_FILAMENT 1
  80. #define LCD_COMMAND_STOP_PRINT 2
  81. #define LCD_COMMAND_FARM_MODE_CONFIRM 4
  82. #define LCD_COMMAND_LONG_PAUSE 5
  83. #define LCD_COMMAND_LONG_PAUSE_RESUME 6
  84. #define LCD_COMMAND_PID_EXTRUDER 7
  85. #define LCD_COMMAND_V2_CAL 8
  86. extern unsigned long lcd_timeoutToStatus;
  87. extern int lcd_commands_type;
  88. extern uint8_t farm_mode;
  89. extern int farm_no;
  90. extern int farm_timer;
  91. extern int farm_status;
  92. #ifdef TMC2130
  93. #define SILENT_MODE_NORMAL 0
  94. #define SILENT_MODE_STEALTH 1
  95. #define SILENT_MODE_OFF SILENT_MODE_NORMAL
  96. #else
  97. #define SILENT_MODE_POWER 0
  98. #define SILENT_MODE_SILENT 1
  99. #define SILENT_MODE_AUTO 2
  100. #define SILENT_MODE_OFF SILENT_MODE_POWER
  101. #endif
  102. extern int8_t SilentModeMenu;
  103. #if defined (SNMM) || defined (SNMM_V2)
  104. extern uint8_t snmm_extruder;
  105. #endif // defined (SNMM) || defined (SNMM_V2)
  106. extern bool cancel_heatup;
  107. extern bool isPrintPaused;
  108. void lcd_ignore_click(bool b=true);
  109. void lcd_commands();
  110. void change_extr(int extr);
  111. static void lcd_colorprint_change();
  112. static int get_ext_nr();
  113. void extr_adj(int extruder);
  114. static void extr_adj_0();
  115. static void extr_adj_1();
  116. static void extr_adj_2();
  117. static void extr_adj_3();
  118. static void fil_load_menu();
  119. static void fil_unload_menu();
  120. static void extr_unload_0();
  121. static void extr_unload_1();
  122. static void extr_unload_2();
  123. static void extr_unload_3();
  124. static void lcd_disable_farm_mode();
  125. static void lcd_set_fan_check();
  126. void extr_unload_all();
  127. void extr_unload_used();
  128. void extr_unload();
  129. static char snmm_stop_print_menu();
  130. #ifdef SDCARD_SORT_ALPHA
  131. static void lcd_sort_type_set();
  132. #endif
  133. static float count_e(float layer_heigth, float extrusion_width, float extrusion_length);
  134. static void lcd_babystep_z();
  135. void stack_error();
  136. void lcd_printer_connected();
  137. void lcd_ping();
  138. void lcd_calibrate_extruder();
  139. void lcd_farm_sdcard_menu();
  140. //void getFileDescription(char *name, char *description);
  141. void lcd_farm_sdcard_menu_w();
  142. //void get_description();
  143. void lcd_wait_for_heater();
  144. void lcd_wait_for_cool_down();
  145. void adjust_bed_reset();
  146. void lcd_extr_cal_reset();
  147. void lcd_temp_cal_show_result(bool result);
  148. bool lcd_wait_for_pinda(float temp);
  149. union MenuData;
  150. void bowden_menu();
  151. char reset_menu();
  152. char choose_extruder_menu();
  153. void lcd_pinda_calibration_menu();
  154. void lcd_calibrate_pinda();
  155. void lcd_temp_calibration_set();
  156. void display_loading();
  157. #if !SDSORT_USES_RAM
  158. void lcd_set_degree();
  159. void lcd_set_progress();
  160. #endif
  161. void lcd_language();
  162. void lcd_wizard();
  163. void lcd_wizard(int state);
  164. static void lcd_send_status();
  165. static void lcd_connect_printer();
  166. #endif //ULTRALCD_H