2015-12-23 15:13:49 +00:00
|
|
|
#ifndef ULTRALCD_H
|
|
|
|
#define ULTRALCD_H
|
|
|
|
|
|
|
|
#include "Marlin.h"
|
2016-07-04 17:00:42 +00:00
|
|
|
#include "mesh_bed_calibration.h"
|
2015-12-23 15:13:49 +00:00
|
|
|
|
|
|
|
#ifdef ULTRA_LCD
|
|
|
|
|
2016-08-02 13:08:34 +00:00
|
|
|
void lcd_update(uint8_t lcdDrawUpdateOverride = 0);
|
2016-06-16 12:29:04 +00:00
|
|
|
// Call with a false parameter to suppress the LCD update from various places like the planner or the temp control.
|
|
|
|
void lcd_update_enable(bool enable);
|
2015-12-23 15:13:49 +00:00
|
|
|
void lcd_init();
|
|
|
|
void lcd_setstatus(const char* message);
|
|
|
|
void lcd_setstatuspgm(const char* message);
|
|
|
|
void lcd_setalertstatuspgm(const char* message);
|
|
|
|
void lcd_reset_alert_level();
|
2016-02-03 12:03:50 +00:00
|
|
|
void lcd_adjust_z();
|
2016-04-28 12:50:25 +00:00
|
|
|
void lcd_pick_babystep();
|
2015-12-23 15:13:49 +00:00
|
|
|
void lcd_alright();
|
2016-02-03 12:03:50 +00:00
|
|
|
void EEPROM_save_B(int pos, int* value);
|
|
|
|
void EEPROM_read_B(int pos, int* value);
|
2015-12-23 15:13:49 +00:00
|
|
|
void lcd_wait_interact();
|
|
|
|
void lcd_change_filament();
|
|
|
|
void lcd_loading_filament();
|
|
|
|
void lcd_change_success();
|
|
|
|
void lcd_loading_color();
|
2016-02-19 16:54:24 +00:00
|
|
|
void lcd_force_language_selection();
|
2016-05-31 12:08:04 +00:00
|
|
|
void lcd_sdcard_stop();
|
2016-07-20 13:02:52 +00:00
|
|
|
void prusa_statistics(int _message);
|
|
|
|
void lcd_confirm_print();
|
2016-08-17 09:56:31 +00:00
|
|
|
void lcd_mylang();
|
2015-12-23 15:13:49 +00:00
|
|
|
bool lcd_detected(void);
|
|
|
|
|
2017-02-22 17:00:41 +00:00
|
|
|
|
2016-05-31 12:08:04 +00:00
|
|
|
static void lcd_selftest();
|
|
|
|
static bool lcd_selfcheck_endstops();
|
|
|
|
static bool lcd_selfcheck_axis(int _axis, int _travel);
|
|
|
|
static bool lcd_selfcheck_check_heater(bool _isbed);
|
|
|
|
static int lcd_selftest_screen(int _step, int _progress, int _progress_scale, bool _clear, int _delay);
|
|
|
|
static void lcd_selftest_screen_step(int _row, int _col, int _state, const char *_name, const char *_indicator);
|
2016-10-11 16:07:27 +00:00
|
|
|
static bool lcd_selftest_fan_dialog(int _fan);
|
2016-05-31 12:08:04 +00:00
|
|
|
static void lcd_selftest_error(int _error_no, const char *_error_1, const char *_error_2);
|
2017-01-09 12:12:39 +00:00
|
|
|
void lcd_menu_statistics();
|
|
|
|
static bool lcd_selfcheck_pulleys(int axis);
|
2016-05-31 12:08:04 +00:00
|
|
|
|
2016-09-01 15:05:15 +00:00
|
|
|
extern const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines);
|
|
|
|
inline const char* lcd_display_message_fullscreen_P(const char *msg)
|
|
|
|
{ uint8_t nlines; return lcd_display_message_fullscreen_P(msg, nlines); }
|
|
|
|
|
2016-07-07 18:26:59 +00:00
|
|
|
extern void lcd_wait_for_click();
|
2016-07-07 09:51:24 +00:00
|
|
|
extern void lcd_show_fullscreen_message_and_wait_P(const char *msg);
|
|
|
|
// 0: no, 1: yes, -1: timeouted
|
2017-01-25 17:54:54 +00:00
|
|
|
extern int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting = true, bool default_yes = false);
|
2016-07-04 17:00:42 +00:00
|
|
|
|
|
|
|
// Ask the user to move the Z axis up to the end stoppers and let
|
|
|
|
// the user confirm that it has been done.
|
2016-08-08 17:17:19 +00:00
|
|
|
extern bool lcd_calibrate_z_end_stop_manual(bool only_z);
|
2016-07-04 17:00:42 +00:00
|
|
|
// Show the result of the calibration process on the LCD screen.
|
2016-07-06 14:12:04 +00:00
|
|
|
extern void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask);
|
2016-07-04 17:00:42 +00:00
|
|
|
|
2016-06-16 12:29:04 +00:00
|
|
|
extern void lcd_diag_show_end_stops();
|
|
|
|
|
2015-12-23 15:13:49 +00:00
|
|
|
#ifdef DOGLCD
|
|
|
|
extern int lcd_contrast;
|
|
|
|
void lcd_setcontrast(uint8_t value);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static unsigned char blink = 0; // Variable for visualization of fan rotation in GLCD
|
|
|
|
|
|
|
|
#define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
|
|
|
|
#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
|
2016-02-19 16:54:24 +00:00
|
|
|
#define LCD_MESSAGERPGM(x) lcd_setstatuspgm((x))
|
|
|
|
#define LCD_ALERTMESSAGERPGM(x) lcd_setalertstatuspgm((x))
|
2015-12-23 15:13:49 +00:00
|
|
|
|
|
|
|
#define LCD_UPDATE_INTERVAL 100
|
|
|
|
#define LCD_TIMEOUT_TO_STATUS 15000
|
|
|
|
|
|
|
|
#ifdef ULTIPANEL
|
|
|
|
void lcd_buttons_update();
|
|
|
|
extern volatile uint8_t buttons; //the last checked buttons in a bit array.
|
|
|
|
#ifdef REPRAPWORLD_KEYPAD
|
|
|
|
extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
FORCE_INLINE void lcd_buttons_update() {}
|
|
|
|
#endif
|
2016-08-04 11:02:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
// To be used in lcd_commands_type.
|
|
|
|
#define LCD_COMMAND_IDLE 0
|
|
|
|
#define LCD_COMMAND_LOAD_FILAMENT 1
|
|
|
|
#define LCD_COMMAND_STOP_PRINT 2
|
|
|
|
#define LCD_COMMAND_FARM_MODE_CONFIRM 4
|
2017-03-28 15:29:10 +00:00
|
|
|
#define LCD_COMMAND_LONG_PAUSE 5
|
|
|
|
#define LCD_COMMAND_LONG_PAUSE_RESUME 6
|
2017-03-31 15:12:16 +00:00
|
|
|
#define LCD_COMMAND_PID_EXTRUDER 7
|
2016-08-04 11:02:45 +00:00
|
|
|
|
2016-10-07 15:21:06 +00:00
|
|
|
extern unsigned long lcd_timeoutToStatus;
|
2016-07-20 13:02:52 +00:00
|
|
|
extern int lcd_commands_type;
|
2015-12-23 15:13:49 +00:00
|
|
|
|
2017-03-01 14:34:41 +00:00
|
|
|
extern uint8_t farm_mode;
|
2016-07-20 13:02:52 +00:00
|
|
|
extern int farm_no;
|
|
|
|
extern int farm_timer;
|
|
|
|
extern int farm_status;
|
|
|
|
|
2017-04-30 15:08:00 +00:00
|
|
|
#ifdef SNMM
|
|
|
|
extern uint8_t snmm_extruder;
|
|
|
|
#endif // SNMM
|
|
|
|
|
2015-12-23 15:13:49 +00:00
|
|
|
extern bool cancel_heatup;
|
2017-03-30 14:48:10 +00:00
|
|
|
extern bool isPrintPaused;
|
2015-12-23 15:13:49 +00:00
|
|
|
|
|
|
|
#ifdef FILAMENT_LCD_DISPLAY
|
|
|
|
extern unsigned long message_millis;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void lcd_buzz(long duration,uint16_t freq);
|
|
|
|
bool lcd_clicked();
|
|
|
|
|
|
|
|
void lcd_ignore_click(bool b=true);
|
2016-05-31 12:08:04 +00:00
|
|
|
void lcd_commands();
|
|
|
|
|
2015-12-23 15:13:49 +00:00
|
|
|
#ifdef NEWPANEL
|
|
|
|
#define EN_C (1<<BLEN_C)
|
|
|
|
#define EN_B (1<<BLEN_B)
|
|
|
|
#define EN_A (1<<BLEN_A)
|
|
|
|
|
|
|
|
#define LCD_CLICKED (buttons&EN_C)
|
|
|
|
#ifdef REPRAPWORLD_KEYPAD
|
|
|
|
#define EN_REPRAPWORLD_KEYPAD_F3 (1<<BLEN_REPRAPWORLD_KEYPAD_F3)
|
|
|
|
#define EN_REPRAPWORLD_KEYPAD_F2 (1<<BLEN_REPRAPWORLD_KEYPAD_F2)
|
|
|
|
#define EN_REPRAPWORLD_KEYPAD_F1 (1<<BLEN_REPRAPWORLD_KEYPAD_F1)
|
|
|
|
#define EN_REPRAPWORLD_KEYPAD_UP (1<<BLEN_REPRAPWORLD_KEYPAD_UP)
|
|
|
|
#define EN_REPRAPWORLD_KEYPAD_RIGHT (1<<BLEN_REPRAPWORLD_KEYPAD_RIGHT)
|
|
|
|
#define EN_REPRAPWORLD_KEYPAD_MIDDLE (1<<BLEN_REPRAPWORLD_KEYPAD_MIDDLE)
|
|
|
|
#define EN_REPRAPWORLD_KEYPAD_DOWN (1<<BLEN_REPRAPWORLD_KEYPAD_DOWN)
|
|
|
|
#define EN_REPRAPWORLD_KEYPAD_LEFT (1<<BLEN_REPRAPWORLD_KEYPAD_LEFT)
|
|
|
|
|
|
|
|
#define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
|
|
|
|
#define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
|
|
|
|
#define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
|
|
|
|
#define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
|
|
|
|
#define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
|
|
|
|
#define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
|
|
|
|
#define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
|
|
|
|
#define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
|
|
|
|
#endif //REPRAPWORLD_KEYPAD
|
|
|
|
#else
|
|
|
|
//atomic, do not change
|
|
|
|
#define B_LE (1<<BL_LE)
|
|
|
|
#define B_UP (1<<BL_UP)
|
|
|
|
#define B_MI (1<<BL_MI)
|
|
|
|
#define B_DW (1<<BL_DW)
|
|
|
|
#define B_RI (1<<BL_RI)
|
|
|
|
#define B_ST (1<<BL_ST)
|
|
|
|
#define EN_B (1<<BLEN_B)
|
|
|
|
#define EN_A (1<<BLEN_A)
|
|
|
|
|
|
|
|
#define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
|
|
|
|
#endif//NEWPANEL
|
|
|
|
|
|
|
|
#else //no LCD
|
2016-05-31 12:08:04 +00:00
|
|
|
FORCE_INLINE void
|
|
|
|
{}
|
2015-12-23 15:13:49 +00:00
|
|
|
FORCE_INLINE void lcd_init() {}
|
|
|
|
FORCE_INLINE void lcd_setstatus(const char* message) {}
|
|
|
|
FORCE_INLINE void lcd_buttons_update() {}
|
|
|
|
FORCE_INLINE void lcd_reset_alert_level() {}
|
|
|
|
FORCE_INLINE void lcd_buzz(long duration,uint16_t freq) {}
|
|
|
|
FORCE_INLINE bool lcd_detected(void) { return true; }
|
|
|
|
|
|
|
|
#define LCD_MESSAGEPGM(x)
|
|
|
|
#define LCD_ALERTMESSAGEPGM(x)
|
|
|
|
|
|
|
|
#endif //ULTRA_LCD
|
|
|
|
|
|
|
|
char *itostr2(const uint8_t &x);
|
|
|
|
char *itostr31(const int &xx);
|
|
|
|
char *itostr3(const int &xx);
|
|
|
|
char *itostr3left(const int &xx);
|
|
|
|
char *itostr4(const int &xx);
|
|
|
|
|
|
|
|
char *ftostr3(const float &x);
|
|
|
|
char *ftostr31ns(const float &x); // float to string without sign character
|
|
|
|
char *ftostr31(const float &x);
|
|
|
|
char *ftostr32(const float &x);
|
2016-05-31 12:08:04 +00:00
|
|
|
char *ftostr32ns(const float &x);
|
2015-12-23 15:13:49 +00:00
|
|
|
char *ftostr43(const float &x);
|
2016-05-01 11:56:55 +00:00
|
|
|
char *ftostr12ns(const float &x);
|
|
|
|
char *ftostr13ns(const float &x);
|
2015-12-23 15:13:49 +00:00
|
|
|
char *ftostr32sp(const float &x); // remove zero-padding from ftostr32
|
|
|
|
char *ftostr5(const float &x);
|
|
|
|
char *ftostr51(const float &x);
|
|
|
|
char *ftostr52(const float &x);
|
|
|
|
|
2016-06-16 12:29:04 +00:00
|
|
|
|
|
|
|
extern void lcd_implementation_clear();
|
|
|
|
extern void lcd_printPGM(const char* str);
|
|
|
|
extern void lcd_print_at_PGM(uint8_t x, uint8_t y, const char* str);
|
2016-07-07 18:26:59 +00:00
|
|
|
extern void lcd_implementation_write(char c);
|
2016-06-16 12:29:04 +00:00
|
|
|
extern void lcd_implementation_print(const char *str);
|
|
|
|
extern void lcd_implementation_print(int8_t i);
|
|
|
|
extern void lcd_implementation_print_at(uint8_t x, uint8_t y, int8_t i);
|
|
|
|
extern void lcd_implementation_print(int i);
|
|
|
|
extern void lcd_implementation_print_at(uint8_t x, uint8_t y, int i);
|
|
|
|
extern void lcd_implementation_print(float f);
|
|
|
|
extern void lcd_implementation_print_at(uint8_t x, uint8_t y, const char *str);
|
|
|
|
|
2017-01-09 12:12:39 +00:00
|
|
|
|
|
|
|
void change_extr(int extr);
|
|
|
|
static int get_ext_nr();
|
|
|
|
static void extr_adj(int extruder);
|
|
|
|
static void extr_adj_0();
|
|
|
|
static void extr_adj_1();
|
|
|
|
static void extr_adj_2();
|
|
|
|
static void extr_adj_3();
|
|
|
|
static void fil_load_menu();
|
|
|
|
static void fil_unload_menu();
|
|
|
|
static void extr_unload_0();
|
|
|
|
static void extr_unload_1();
|
|
|
|
static void extr_unload_2();
|
|
|
|
static void extr_unload_3();
|
2017-03-01 14:34:41 +00:00
|
|
|
static void lcd_disable_farm_mode();
|
2017-01-09 12:12:39 +00:00
|
|
|
|
|
|
|
void stack_error();
|
2017-03-07 18:19:13 +00:00
|
|
|
static void lcd_ping_allert();
|
|
|
|
void lcd_printer_connected();
|
|
|
|
void lcd_ping();
|
2017-02-02 14:51:16 +00:00
|
|
|
|
2017-01-09 12:12:39 +00:00
|
|
|
void lcd_calibrate_extruder();
|
|
|
|
void lcd_farm_sdcard_menu();
|
|
|
|
|
|
|
|
//void getFileDescription(char *name, char *description);
|
|
|
|
|
|
|
|
void lcd_farm_sdcard_menu_w();
|
|
|
|
//void get_description();
|
|
|
|
|
|
|
|
void lcd_wait_for_cool_down();
|
|
|
|
void adjust_bed_reset();
|
2017-01-31 09:26:36 +00:00
|
|
|
void lcd_extr_cal_reset();
|
2017-01-09 12:12:39 +00:00
|
|
|
|
|
|
|
union MenuData;
|
|
|
|
|
|
|
|
char reset_menu();
|
2017-03-06 10:19:21 +00:00
|
|
|
|
2017-04-06 16:57:11 +00:00
|
|
|
void lcd_pinda_calibration_menu();
|
|
|
|
void lcd_calibrate_pinda();
|
|
|
|
void lcd_temp_calibration_set();
|
2017-04-27 12:16:12 +00:00
|
|
|
|
2017-01-09 12:12:39 +00:00
|
|
|
#endif //ULTRALCD_H
|