2016-07-22 13:28:01 +00:00
# ifndef ULTRALCD_H
# define ULTRALCD_H
# include "Marlin.h"
2018-07-16 17:29:27 +00:00
# include "lcd.h"
2018-07-16 15:23:35 +00:00
# include "conv2str.h"
2018-08-01 20:37:10 +00:00
# include "menu.h"
2018-08-07 13:46:23 +00:00
# include "mesh_bed_calibration.h"
2016-07-22 13:28:01 +00:00
2018-06-10 20:06:00 +00:00
extern int lcd_puts_P ( const char * str ) ;
extern int lcd_printf_P ( const char * format , . . . ) ;
2018-07-16 00:13:52 +00:00
extern void menu_lcd_longpress_func ( void ) ;
extern void menu_lcd_charsetup_func ( void ) ;
extern void menu_lcd_lcdupdate_func ( void ) ;
2016-07-22 13:28:01 +00:00
2018-08-19 16:34:57 +00:00
// Call with a false parameter to suppress the LCD update from various places like the planner or the temp control.
void ultralcd_init ( ) ;
void lcd_setstatus ( const char * message ) ;
void lcd_setstatuspgm ( const char * message ) ;
void lcd_setalertstatuspgm ( const char * message ) ;
void lcd_reset_alert_level ( ) ;
uint8_t get_message_level ( ) ;
void lcd_adjust_z ( ) ;
void lcd_pick_babystep ( ) ;
void lcd_alright ( ) ;
2018-11-01 15:29:09 +00:00
void show_preheat_nozzle_warning ( ) ;
2018-08-19 16:34:57 +00:00
void EEPROM_save_B ( int pos , int * value ) ;
void EEPROM_read_B ( int pos , int * value ) ;
void lcd_wait_interact ( ) ;
void lcd_loading_filament ( ) ;
void lcd_change_success ( ) ;
void lcd_loading_color ( ) ;
void lcd_sdcard_stop ( ) ;
2018-09-06 06:32:50 +00:00
void lcd_pause_print ( ) ;
void lcd_resume_print ( ) ;
2018-08-19 16:34:57 +00:00
void lcd_print_stop ( ) ;
void prusa_statistics ( int _message , uint8_t _col_nr = 0 ) ;
void lcd_confirm_print ( ) ;
unsigned char lcd_choose_color ( ) ;
2018-10-31 20:48:05 +00:00
void lcd_load_filament_color_check ( ) ;
2018-06-07 22:20:28 +00:00
//void lcd_mylang();
2016-07-22 13:28:01 +00:00
2018-08-19 16:34:57 +00:00
extern bool lcd_selftest ( ) ;
2018-07-23 11:35:38 +00:00
2018-08-19 16:34:57 +00:00
void lcd_menu_statistics ( ) ;
2016-07-22 13:28:01 +00:00
2018-08-02 16:54:00 +00:00
extern const char * lcd_display_message_fullscreen_P ( const char * msg , uint8_t & nlines ) ;
extern const char * lcd_display_message_fullscreen_P ( const char * msg ) ;
2016-09-01 08:44:24 +00:00
2018-08-27 18:57:57 +00:00
extern void lcd_return_to_status ( ) ;
2018-08-19 16:34:57 +00:00
extern void lcd_wait_for_click ( ) ;
2018-11-02 22:03:14 +00:00
extern bool lcd_wait_for_click_delay ( uint16_t nDelay ) ;
2018-08-19 16:34:57 +00:00
extern void lcd_show_fullscreen_message_and_wait_P ( const char * msg ) ;
// 0: no, 1: yes, -1: timeouted
extern int8_t lcd_show_fullscreen_message_yes_no_and_wait_P ( const char * msg , bool allow_timeouting = true , bool default_yes = false ) ;
2018-09-14 14:06:25 +00:00
extern int8_t lcd_show_multiscreen_message_two_choices_and_wait_P ( const char * msg , bool allow_timeouting , bool default_yes ,
const char * first_choice , const char * second_choice ) ;
2018-08-19 16:34:57 +00:00
extern int8_t lcd_show_multiscreen_message_yes_no_and_wait_P ( const char * msg , bool allow_timeouting = true , bool default_yes = false ) ;
// Ask the user to move the Z axis up to the end stoppers and let
// the user confirm that it has been done.
2016-07-22 13:28:01 +00:00
2018-08-19 16:34:57 +00:00
# ifndef TMC2130
extern bool lcd_calibrate_z_end_stop_manual ( bool only_z ) ;
# endif
2016-07-22 13:28:01 +00:00
2018-08-19 16:34:57 +00:00
// Show the result of the calibration process on the LCD screen.
2018-08-21 15:56:34 +00:00
extern void lcd_bed_calibration_show_result ( BedSkewOffsetDetectionResultType result , uint8_t point_too_far_mask ) ;
2016-07-22 13:28:01 +00:00
2018-08-19 16:34:57 +00:00
extern void lcd_diag_show_end_stops ( ) ;
# define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
# define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
# define LCD_MESSAGERPGM(x) lcd_setstatuspgm((x))
# define LCD_ALERTMESSAGERPGM(x) lcd_setalertstatuspgm((x))
// 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
# define LCD_COMMAND_LONG_PAUSE 5
# define LCD_COMMAND_PID_EXTRUDER 7
# define LCD_COMMAND_V2_CAL 8
extern int lcd_commands_type ;
2018-09-04 06:06:03 +00:00
extern int8_t FSensorStateMenu ;
2018-08-19 16:34:57 +00:00
# define CUSTOM_MSG_TYPE_STATUS 0 // status message from lcd_status_message variable
# define CUSTOM_MSG_TYPE_MESHBL 1 // Mesh bed leveling in progress
# define CUSTOM_MSG_TYPE_F_LOAD 2 // Loading filament in progress
# define CUSTOM_MSG_TYPE_PIDCAL 3 // PID tuning in progress
# define CUSTOM_MSG_TYPE_TEMCAL 4 // PINDA temp calibration
# define CUSTOM_MSG_TYPE_TEMPRE 5 // Temp compensation preheat
extern unsigned int custom_message_type ;
extern unsigned int custom_message_state ;
extern uint8_t farm_mode ;
extern int farm_no ;
extern int farm_timer ;
extern int farm_status ;
# ifdef TMC2130
# define SILENT_MODE_NORMAL 0
# define SILENT_MODE_STEALTH 1
# define SILENT_MODE_OFF SILENT_MODE_NORMAL
# else
# define SILENT_MODE_POWER 0
# define SILENT_MODE_SILENT 1
# define SILENT_MODE_AUTO 2
# define SILENT_MODE_OFF SILENT_MODE_POWER
# endif
2016-07-22 13:28:01 +00:00
2018-08-19 16:34:57 +00:00
extern int8_t SilentModeMenu ;
2016-08-11 08:42:53 +00:00
2018-08-19 16:34:57 +00:00
extern bool cancel_heatup ;
extern bool isPrintPaused ;
2016-07-22 13:28:01 +00:00
2018-08-19 16:34:57 +00:00
void lcd_ignore_click ( bool b = true ) ;
void lcd_commands ( ) ;
2016-07-22 13:28:01 +00:00
2017-03-24 18:47:50 +00:00
void change_extr ( int extr ) ;
2018-04-25 18:47:19 +00:00
void extr_adj ( int extruder ) ;
2018-07-23 11:35:38 +00:00
2018-10-31 20:48:05 +00:00
# ifdef SNMM
2017-06-29 16:35:43 +00:00
void extr_unload_all ( ) ;
void extr_unload_used ( ) ;
2018-10-31 20:48:05 +00:00
# endif //SNMM
2017-06-29 16:35:43 +00:00
void extr_unload ( ) ;
2017-03-24 18:47:50 +00:00
2019-02-13 22:53:00 +00:00
typedef enum
{ e_FILAMENT_ACTION_none , e_FILAMENT_ACTION_Load , e_FILAMENT_ACTION_autoLoad , e_FILAMENT_ACTION_unLoad , e_FILAMENT_ACTION_mmuLoad , e_FILAMENT_ACTION_mmuUnLoad , e_FILAMENT_ACTION_mmuEject } eFILAMENT_ACTION ; // 'none' state is used as flag for (filament) autoLoad (i.e. opposite for 'autoLoad' state)
extern eFILAMENT_ACTION eFilamentAction ;
2019-02-06 00:58:05 +00:00
extern bool bFilamentFirstRun ;
extern bool bFilamentPreheatState ;
2019-02-20 02:01:33 +00:00
extern bool bFilamentAction ;
void mFilamentItem ( uint16_t nTemp , uint16_t nTempBed ) ;
2019-02-26 16:33:37 +00:00
void mFilamentItemForce ( ) ;
2019-02-06 00:58:05 +00:00
void mFilamentMenu ( ) ;
2018-07-31 10:24:22 +00:00
void unload_filament ( ) ;
2017-03-24 18:47:50 +00:00
void stack_error ( ) ;
void lcd_printer_connected ( ) ;
void lcd_ping ( ) ;
void lcd_calibrate_extruder ( ) ;
void lcd_farm_sdcard_menu ( ) ;
//void getFileDescription(char *name, char *description);
void lcd_farm_sdcard_menu_w ( ) ;
//void get_description();
2018-01-15 10:30:28 +00:00
void lcd_wait_for_heater ( ) ;
2017-12-14 18:36:32 +00:00
void lcd_wait_for_cool_down ( ) ;
2017-03-24 18:47:50 +00:00
void lcd_extr_cal_reset ( ) ;
2018-04-24 11:43:51 +00:00
void lcd_temp_cal_show_result ( bool result ) ;
bool lcd_wait_for_pinda ( float temp ) ;
2017-06-29 16:35:43 +00:00
void bowden_menu ( ) ;
2017-03-24 18:47:50 +00:00
char reset_menu ( ) ;
2018-09-11 20:33:13 +00:00
uint8_t choose_menu_P ( const char * header , const char * item , const char * last_item = nullptr ) ;
2017-06-29 16:35:43 +00:00
void lcd_pinda_calibration_menu ( ) ;
void lcd_calibrate_pinda ( ) ;
void lcd_temp_calibration_set ( ) ;
void display_loading ( ) ;
2017-12-10 10:08:50 +00:00
# if !SDSORT_USES_RAM
2018-08-19 16:34:57 +00:00
void lcd_set_degree ( ) ;
void lcd_set_progress ( ) ;
2017-12-10 10:08:50 +00:00
# endif
2018-06-10 14:04:32 +00:00
void lcd_language ( ) ;
2017-11-07 15:49:04 +00:00
void lcd_wizard ( ) ;
2018-11-05 16:43:07 +00:00
bool lcd_autoDepleteEnabled ( ) ;
2018-09-13 14:07:19 +00:00
//! @brief Wizard state
enum class WizState : uint8_t
{
Run , //!< run wizard? Entry point.
Restore , //!< restore calibration status
Selftest ,
Xyz , //!< xyz calibration
Z , //!< z calibration
IsFil , //!< Is filament loaded? Entry point for 1st layer calibration
2018-09-14 16:29:14 +00:00
PreheatPla , //!< waiting for preheat nozzle for PLA
Preheat , //!< Preheat for any material
2018-09-14 14:06:25 +00:00
Unload , //!< Unload filament
2018-09-13 14:07:19 +00:00
LoadFil , //!< Load filament
IsPla , //!< Is PLA filament?
Lay1Cal , //!< First layer calibration
RepeatLay1Cal , //!< Repeat first layer calibration?
Finish , //!< Deactivate wizard
} ;
void lcd_wizard ( WizState state ) ;
2017-11-07 15:49:04 +00:00
2018-03-28 16:53:37 +00:00
# endif //ULTRALCD_H