|  | @@ -40,6 +40,7 @@
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  #include "static_assert.h"
 |  |  #include "static_assert.h"
 | 
												
													
														
															|  |  #include "io_atmega2560.h"
 |  |  #include "io_atmega2560.h"
 | 
												
													
														
															|  | 
 |  | +#include "first_lay_cal.h"
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  int scrollstuff = 0;
 |  |  int scrollstuff = 0;
 | 
												
											
												
													
														
															|  | @@ -73,10 +74,10 @@ extern void crashdet_disable();
 | 
												
													
														
															|  |  bool presort_flag = false;
 |  |  bool presort_flag = false;
 | 
												
													
														
															|  |  #endif
 |  |  #endif
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -int lcd_commands_type = LCD_COMMAND_IDLE;
 |  | 
 | 
												
													
														
															|  | -int lcd_commands_step = 0;
 |  | 
 | 
												
													
														
															|  | 
 |  | +LcdCommands lcd_commands_type = LcdCommands::Idle;
 | 
												
													
														
															|  | 
 |  | +static uint8_t lcd_commands_step = 0;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -unsigned int custom_message_type = CUSTOM_MSG_TYPE_STATUS;
 |  | 
 | 
												
													
														
															|  | 
 |  | +CustomMsg custom_message_type = CustomMsg::Status;
 | 
												
													
														
															|  |  unsigned int custom_message_state = 0;
 |  |  unsigned int custom_message_state = 0;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -84,7 +85,7 @@ bool isPrintPaused = false;
 | 
												
													
														
															|  |  uint8_t farm_mode = 0;
 |  |  uint8_t farm_mode = 0;
 | 
												
													
														
															|  |  int farm_no = 0;
 |  |  int farm_no = 0;
 | 
												
													
														
															|  |  int farm_timer = 8;
 |  |  int farm_timer = 8;
 | 
												
													
														
															|  | -int farm_status = 0;
 |  | 
 | 
												
													
														
															|  | 
 |  | +uint8_t farm_status = 0;
 | 
												
													
														
															|  |  bool printer_connected = true;
 |  |  bool printer_connected = true;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  unsigned long display_time; //just timer for showing pid finished message on lcd;
 |  |  unsigned long display_time; //just timer for showing pid finished message on lcd;
 | 
												
											
												
													
														
															|  | @@ -130,6 +131,7 @@ static void lcd_control_volumetric_menu();
 | 
												
													
														
															|  |  static void lcd_settings_linearity_correction_menu_save();
 |  |  static void lcd_settings_linearity_correction_menu_save();
 | 
												
													
														
															|  |  static void prusa_stat_printerstatus(int _status);
 |  |  static void prusa_stat_printerstatus(int _status);
 | 
												
													
														
															|  |  static void prusa_stat_farm_number();
 |  |  static void prusa_stat_farm_number();
 | 
												
													
														
															|  | 
 |  | +static void prusa_stat_diameter();
 | 
												
													
														
															|  |  static void prusa_stat_temperatures();
 |  |  static void prusa_stat_temperatures();
 | 
												
													
														
															|  |  static void prusa_stat_printinfo();
 |  |  static void prusa_stat_printinfo();
 | 
												
													
														
															|  |  static void lcd_farm_no();
 |  |  static void lcd_farm_no();
 | 
												
											
												
													
														
															|  | @@ -165,42 +167,42 @@ static bool lcd_selfcheck_pulleys(int axis);
 | 
												
													
														
															|  |  #endif //TMC2130
 |  |  #endif //TMC2130
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  static bool lcd_selfcheck_check_heater(bool _isbed);
 |  |  static bool lcd_selfcheck_check_heater(bool _isbed);
 | 
												
													
														
															|  | -enum class testScreen : uint_least8_t
 |  | 
 | 
												
													
														
															|  | -{
 |  | 
 | 
												
													
														
															|  | -    extruderFan,
 |  | 
 | 
												
													
														
															|  | -    printFan,
 |  | 
 | 
												
													
														
															|  | -    fansOk,
 |  | 
 | 
												
													
														
															|  | -    endStops,
 |  | 
 | 
												
													
														
															|  | -    axisX,
 |  | 
 | 
												
													
														
															|  | -    axisY,
 |  | 
 | 
												
													
														
															|  | -    axisZ,
 |  | 
 | 
												
													
														
															|  | -    bed,
 |  | 
 | 
												
													
														
															|  | -    hotend,
 |  | 
 | 
												
													
														
															|  | -    hotendOk,
 |  | 
 | 
												
													
														
															|  | -    fsensor,
 |  | 
 | 
												
													
														
															|  | -    fsensorOk,
 |  | 
 | 
												
													
														
															|  | -    allCorrect,
 |  | 
 | 
												
													
														
															|  | -    failed,
 |  | 
 | 
												
													
														
															|  | -    home,
 |  | 
 | 
												
													
														
															|  | 
 |  | +enum class TestScreen : uint_least8_t
 | 
												
													
														
															|  | 
 |  | +{
 | 
												
													
														
															|  | 
 |  | +    ExtruderFan,
 | 
												
													
														
															|  | 
 |  | +    PrintFan,
 | 
												
													
														
															|  | 
 |  | +    FansOk,
 | 
												
													
														
															|  | 
 |  | +    EndStops,
 | 
												
													
														
															|  | 
 |  | +    AxisX,
 | 
												
													
														
															|  | 
 |  | +    AxisY,
 | 
												
													
														
															|  | 
 |  | +    AxisZ,
 | 
												
													
														
															|  | 
 |  | +    Bed,
 | 
												
													
														
															|  | 
 |  | +    Hotend,
 | 
												
													
														
															|  | 
 |  | +    HotendOk,
 | 
												
													
														
															|  | 
 |  | +    Fsensor,
 | 
												
													
														
															|  | 
 |  | +    FsensorOk,
 | 
												
													
														
															|  | 
 |  | +    AllCorrect,
 | 
												
													
														
															|  | 
 |  | +    Failed,
 | 
												
													
														
															|  | 
 |  | +    Home,
 | 
												
													
														
															|  |  };
 |  |  };
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  enum class TestError : uint_least8_t
 |  |  enum class TestError : uint_least8_t
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  | -    heater,
 |  | 
 | 
												
													
														
															|  | -    bed,
 |  | 
 | 
												
													
														
															|  | -    endstops,
 |  | 
 | 
												
													
														
															|  | -    motor,
 |  | 
 | 
												
													
														
															|  | -    endstop,
 |  | 
 | 
												
													
														
															|  | -    printFan,
 |  | 
 | 
												
													
														
															|  | -    extruderFan,
 |  | 
 | 
												
													
														
															|  | -    pulley,
 |  | 
 | 
												
													
														
															|  | -    axis,
 |  | 
 | 
												
													
														
															|  | -    swappedFan,
 |  | 
 | 
												
													
														
															|  | -    wiringFsensor,
 |  | 
 | 
												
													
														
															|  | -    triggeringFsensor,
 |  | 
 | 
												
													
														
															|  | 
 |  | +    Heater,
 | 
												
													
														
															|  | 
 |  | +    Bed,
 | 
												
													
														
															|  | 
 |  | +    Endstops,
 | 
												
													
														
															|  | 
 |  | +    Motor,
 | 
												
													
														
															|  | 
 |  | +    Endstop,
 | 
												
													
														
															|  | 
 |  | +    PrintFan,
 | 
												
													
														
															|  | 
 |  | +    ExtruderFan,
 | 
												
													
														
															|  | 
 |  | +    Pulley,
 | 
												
													
														
															|  | 
 |  | +    Axis,
 | 
												
													
														
															|  | 
 |  | +    SwappedFan,
 | 
												
													
														
															|  | 
 |  | +    WiringFsensor,
 | 
												
													
														
															|  | 
 |  | +    TriggeringFsensor,
 | 
												
													
														
															|  |  };
 |  |  };
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -static int  lcd_selftest_screen(testScreen screen, int _progress, int _progress_scale, bool _clear, int _delay);
 |  | 
 | 
												
													
														
															|  | 
 |  | +static int  lcd_selftest_screen(TestScreen screen, 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);
 |  |  static void lcd_selftest_screen_step(int _row, int _col, int _state, const char *_name, const char *_indicator);
 | 
												
													
														
															|  |  static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite,
 |  |  static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite,
 | 
												
													
														
															|  |  	bool _default=false);
 |  |  	bool _default=false);
 | 
												
											
												
													
														
															|  | @@ -209,10 +211,10 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite,
 | 
												
													
														
															|  |  /** Enumerate for lcd_selftest_fan_auto function.
 |  |  /** Enumerate for lcd_selftest_fan_auto function.
 | 
												
													
														
															|  |   */
 |  |   */
 | 
												
													
														
															|  |  enum class FanCheck : uint_least8_t {
 |  |  enum class FanCheck : uint_least8_t {
 | 
												
													
														
															|  | -    success,
 |  | 
 | 
												
													
														
															|  | -    printFan = TestError::printFan,
 |  | 
 | 
												
													
														
															|  | -    extruderFan = TestError::extruderFan,
 |  | 
 | 
												
													
														
															|  | -    swappedFan = TestError::swappedFan,
 |  | 
 | 
												
													
														
															|  | 
 |  | +    Success,
 | 
												
													
														
															|  | 
 |  | +    PrintFan,
 | 
												
													
														
															|  | 
 |  | +    ExtruderFan,
 | 
												
													
														
															|  | 
 |  | +    SwappedFan,
 | 
												
													
														
															|  |  };
 |  |  };
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  /**
 |  |  /**
 | 
												
											
												
													
														
															|  | @@ -245,13 +247,13 @@ static char snmm_stop_print_menu();
 | 
												
													
														
															|  |  #ifdef SDCARD_SORT_ALPHA
 |  |  #ifdef SDCARD_SORT_ALPHA
 | 
												
													
														
															|  |   static void lcd_sort_type_set();
 |  |   static void lcd_sort_type_set();
 | 
												
													
														
															|  |  #endif
 |  |  #endif
 | 
												
													
														
															|  | -static float count_e(float layer_heigth, float extrusion_width, float extrusion_length);
 |  | 
 | 
												
													
														
															|  |  static void lcd_babystep_z();
 |  |  static void lcd_babystep_z();
 | 
												
													
														
															|  |  static void lcd_send_status();
 |  |  static void lcd_send_status();
 | 
												
													
														
															|  |  #ifdef FARM_CONNECT_MESSAGE
 |  |  #ifdef FARM_CONNECT_MESSAGE
 | 
												
													
														
															|  |  static void lcd_connect_printer();
 |  |  static void lcd_connect_printer();
 | 
												
													
														
															|  |  #endif //FARM_CONNECT_MESSAGE
 |  |  #endif //FARM_CONNECT_MESSAGE
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | 
 |  | +//! Beware: has side effects - forces lcd_draw_update to 2, which means clear the display
 | 
												
													
														
															|  |  void lcd_finishstatus();
 |  |  void lcd_finishstatus();
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  static void lcd_sdcard_menu();
 |  |  static void lcd_sdcard_menu();
 | 
												
											
												
													
														
															|  | @@ -316,7 +318,7 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, char* longF
 | 
												
													
														
															|  |      char c;
 |  |      char c;
 | 
												
													
														
															|  |      int enc_dif = lcd_encoder_diff;
 |  |      int enc_dif = lcd_encoder_diff;
 | 
												
													
														
															|  |      uint8_t n = LCD_WIDTH - 1;
 |  |      uint8_t n = LCD_WIDTH - 1;
 | 
												
													
														
															|  | -    for(int g = 0; g<4;g++){
 |  | 
 | 
												
													
														
															|  | 
 |  | +    for(uint_least8_t g = 0; g<4;g++){
 | 
												
													
														
															|  |        lcd_set_cursor(0, g);
 |  |        lcd_set_cursor(0, g);
 | 
												
													
														
															|  |      lcd_print(' ');
 |  |      lcd_print(' ');
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
											
												
													
														
															|  | @@ -564,7 +566,7 @@ void lcdui_print_temp(char type, int val_current, int val_target)
 | 
												
													
														
															|  |  // Print Z-coordinate (8 chars total)
 |  |  // Print Z-coordinate (8 chars total)
 | 
												
													
														
															|  |  void lcdui_print_Z_coord(void)
 |  |  void lcdui_print_Z_coord(void)
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  | -    if (custom_message_type == CUSTOM_MSG_TYPE_MESHBL)
 |  | 
 | 
												
													
														
															|  | 
 |  | +    if (custom_message_type == CustomMsg::MeshBedLeveling)
 | 
												
													
														
															|  |          lcd_puts_P(_N("Z   --- "));
 |  |          lcd_puts_P(_N("Z   --- "));
 | 
												
													
														
															|  |      else
 |  |      else
 | 
												
													
														
															|  |  		lcd_printf_P(_N("Z%6.2f "), current_position[Z_AXIS]);
 |  |  		lcd_printf_P(_N("Z%6.2f "), current_position[Z_AXIS]);
 | 
												
											
												
													
														
															|  | @@ -759,7 +761,7 @@ void lcdui_print_status_line(void)
 | 
												
													
														
															|  |  			break;
 |  |  			break;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | -	else if ((IS_SD_PRINTING) && (custom_message_type == CUSTOM_MSG_TYPE_STATUS))
 |  | 
 | 
												
													
														
															|  | 
 |  | +	else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status))
 | 
												
													
														
															|  |  	{ // If printing from SD, show what we are printing
 |  |  	{ // If printing from SD, show what we are printing
 | 
												
													
														
															|  |  		if(strlen(card.longFilename) > LCD_WIDTH)
 |  |  		if(strlen(card.longFilename) > LCD_WIDTH)
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
											
												
													
														
															|  | @@ -793,10 +795,10 @@ void lcdui_print_status_line(void)
 | 
												
													
														
															|  |  	{ // Otherwise check for other special events
 |  |  	{ // Otherwise check for other special events
 | 
												
													
														
															|  |     		switch (custom_message_type)
 |  |     		switch (custom_message_type)
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  | -		case CUSTOM_MSG_TYPE_STATUS: // Nothing special, print status message normally
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case CustomMsg::Status: // Nothing special, print status message normally
 | 
												
													
														
															|  |  			lcd_print(lcd_status_message);
 |  |  			lcd_print(lcd_status_message);
 | 
												
													
														
															|  |  			break;
 |  |  			break;
 | 
												
													
														
															|  | -		case CUSTOM_MSG_TYPE_MESHBL: // If mesh bed leveling in progress, show the status
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status
 | 
												
													
														
															|  |  			if (custom_message_state > 10)
 |  |  			if (custom_message_state > 10)
 | 
												
													
														
															|  |  			{
 |  |  			{
 | 
												
													
														
															|  |  				lcd_set_cursor(0, 3);
 |  |  				lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -812,7 +814,7 @@ void lcdui_print_status_line(void)
 | 
												
													
														
															|  |  				{
 |  |  				{
 | 
												
													
														
															|  |  					lcd_puts_P(_T(WELCOME_MSG));
 |  |  					lcd_puts_P(_T(WELCOME_MSG));
 | 
												
													
														
															|  |  					lcd_setstatuspgm(_T(WELCOME_MSG));
 |  |  					lcd_setstatuspgm(_T(WELCOME_MSG));
 | 
												
													
														
															|  | -					custom_message_type = CUSTOM_MSG_TYPE_STATUS;
 |  | 
 | 
												
													
														
															|  | 
 |  | +					custom_message_type = CustomMsg::Status;
 | 
												
													
														
															|  |  				}
 |  |  				}
 | 
												
													
														
															|  |  				if (custom_message_state > 3 && custom_message_state <= 10 )
 |  |  				if (custom_message_state > 3 && custom_message_state <= 10 )
 | 
												
													
														
															|  |  				{
 |  |  				{
 | 
												
											
												
													
														
															|  | @@ -824,10 +826,10 @@ void lcdui_print_status_line(void)
 | 
												
													
														
															|  |  				}
 |  |  				}
 | 
												
													
														
															|  |  			}
 |  |  			}
 | 
												
													
														
															|  |  			break;
 |  |  			break;
 | 
												
													
														
															|  | -		case CUSTOM_MSG_TYPE_F_LOAD: // If loading filament, print status
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case CustomMsg::FilamentLoading: // If loading filament, print status
 | 
												
													
														
															|  |  			lcd_print(lcd_status_message);
 |  |  			lcd_print(lcd_status_message);
 | 
												
													
														
															|  |  			break;
 |  |  			break;
 | 
												
													
														
															|  | -		case CUSTOM_MSG_TYPE_PIDCAL: // PID tuning in progress
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case CustomMsg::PidCal: // PID tuning in progress
 | 
												
													
														
															|  |  			lcd_print(lcd_status_message);
 |  |  			lcd_print(lcd_status_message);
 | 
												
													
														
															|  |  			if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0)
 |  |  			if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0)
 | 
												
													
														
															|  |  			{
 |  |  			{
 | 
												
											
												
													
														
															|  | @@ -837,7 +839,7 @@ void lcdui_print_status_line(void)
 | 
												
													
														
															|  |  				lcd_print(itostr3left(pid_number_of_cycles));
 |  |  				lcd_print(itostr3left(pid_number_of_cycles));
 | 
												
													
														
															|  |  			}
 |  |  			}
 | 
												
													
														
															|  |  			break;
 |  |  			break;
 | 
												
													
														
															|  | -		case CUSTOM_MSG_TYPE_TEMCAL: // PINDA temp calibration in progress
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case CustomMsg::TempCal: // PINDA temp calibration in progress
 | 
												
													
														
															|  |  			{
 |  |  			{
 | 
												
													
														
															|  |  				char progress[4];
 |  |  				char progress[4];
 | 
												
													
														
															|  |  				lcd_set_cursor(0, 3);
 |  |  				lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -847,7 +849,7 @@ void lcdui_print_status_line(void)
 | 
												
													
														
															|  |  				lcd_print(progress);
 |  |  				lcd_print(progress);
 | 
												
													
														
															|  |  			}
 |  |  			}
 | 
												
													
														
															|  |  			break;
 |  |  			break;
 | 
												
													
														
															|  | -		case CUSTOM_MSG_TYPE_TEMPRE: // temp compensation preheat
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case CustomMsg::TempCompPreheat: // temp compensation preheat
 | 
												
													
														
															|  |  			lcd_set_cursor(0, 3);
 |  |  			lcd_set_cursor(0, 3);
 | 
												
													
														
															|  |  			lcd_puts_P(_i("PINDA Heating"));////MSG_PINDA_PREHEAT c=20 r=1
 |  |  			lcd_puts_P(_i("PINDA Heating"));////MSG_PINDA_PREHEAT c=20 r=1
 | 
												
													
														
															|  |  			if (custom_message_state <= PINDA_HEAT_T)
 |  |  			if (custom_message_state <= PINDA_HEAT_T)
 | 
												
											
												
													
														
															|  | @@ -986,6 +988,8 @@ static void lcd_status_screen()
 | 
												
													
														
															|  |  			{
 |  |  			{
 | 
												
													
														
															|  |  			case 8:
 |  |  			case 8:
 | 
												
													
														
															|  |  				prusa_statistics(21);
 |  |  				prusa_statistics(21);
 | 
												
													
														
															|  | 
 |  | +				if(loading_flag)
 | 
												
													
														
															|  | 
 |  | +					prusa_statistics(22);
 | 
												
													
														
															|  |  				break;
 |  |  				break;
 | 
												
													
														
															|  |  			case 5:
 |  |  			case 5:
 | 
												
													
														
															|  |  				if (IS_SD_PRINTING)
 |  |  				if (IS_SD_PRINTING)
 | 
												
											
												
													
														
															|  | @@ -995,7 +999,7 @@ static void lcd_status_screen()
 | 
												
													
														
															|  |  		} // end of farm_mode
 |  |  		} // end of farm_mode
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  		lcd_status_update_delay = 10;   /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
 |  |  		lcd_status_update_delay = 10;   /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
 | 
												
													
														
															|  | -		if (lcd_commands_type != LCD_COMMAND_IDLE)
 |  | 
 | 
												
													
														
															|  | 
 |  | +		if (lcd_commands_type != LcdCommands::Idle)
 | 
												
													
														
															|  |  			lcd_commands();
 |  |  			lcd_commands();
 | 
												
													
														
															|  |  	} // end of lcd_draw_update
 |  |  	} // end of lcd_draw_update
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -1018,7 +1022,10 @@ static void lcd_status_screen()
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -	if (current_click && (lcd_commands_type != LCD_COMMAND_STOP_PRINT)) //click is aborted unless stop print finishes
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (current_click
 | 
												
													
														
															|  | 
 |  | +		&& (lcd_commands_type != LcdCommands::StopPrint) //click is aborted unless stop print finishes
 | 
												
													
														
															|  | 
 |  | +		&& ( menu_block_entering_on_serious_errors == SERIOUS_ERR_NONE ) // or a serious error blocks entering the menu
 | 
												
													
														
															|  | 
 |  | +	)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure
 |  |  		menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure
 | 
												
													
														
															|  |  		menu_submenu(lcd_main_menu);
 |  |  		menu_submenu(lcd_main_menu);
 | 
												
											
												
													
														
															|  | @@ -1056,18 +1063,17 @@ static void lcd_status_screen()
 | 
												
													
														
															|  |  		feedmultiply = 999;
 |  |  		feedmultiply = 999;
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  |  void lcd_commands()
 |  |  void lcd_commands()
 | 
												
													
														
															|  |  {	
 |  |  {	
 | 
												
													
														
															|  | -	if (lcd_commands_type == LCD_COMMAND_LONG_PAUSE)
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (lcd_commands_type == LcdCommands::LongPause)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		if (!blocks_queued() && !homing_flag)
 |  |  		if (!blocks_queued() && !homing_flag)
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  |  			lcd_setstatuspgm(_i("Print paused"));////MSG_PRINT_PAUSED c=20 r=1
 |  |  			lcd_setstatuspgm(_i("Print paused"));////MSG_PRINT_PAUSED c=20 r=1
 | 
												
													
														
															|  |  			long_pause();
 |  |  			long_pause();
 | 
												
													
														
															|  | -               if (lcd_commands_type == LCD_COMMAND_LONG_PAUSE) // !!! because "lcd_commands_type" can be changed during/inside "long_pause()"
 |  | 
 | 
												
													
														
															|  | 
 |  | +               if (lcd_commands_type == LcdCommands::LongPause) // !!! because "lcd_commands_type" can be changed during/inside "long_pause()"
 | 
												
													
														
															|  |                 {
 |  |                 {
 | 
												
													
														
															|  | -                    lcd_commands_type = 0;
 |  | 
 | 
												
													
														
															|  | 
 |  | +                    lcd_commands_type = LcdCommands::Idle;
 | 
												
													
														
															|  |                      lcd_commands_step = 0;
 |  |                      lcd_commands_step = 0;
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
											
												
													
														
															|  | @@ -1075,7 +1081,7 @@ void lcd_commands()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  #ifdef SNMM
 |  |  #ifdef SNMM
 | 
												
													
														
															|  | -	if (lcd_commands_type == LCD_COMMAND_V2_CAL)
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (lcd_commands_type == LcdCommands::Layer1Cal)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		char cmd1[30];
 |  |  		char cmd1[30];
 | 
												
													
														
															|  |  		float width = 0.4;
 |  |  		float width = 0.4;
 | 
												
											
												
													
														
															|  | @@ -1340,300 +1346,115 @@ void lcd_commands()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  #else //if not SNMM
 |  |  #else //if not SNMM
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -	if (lcd_commands_type == LCD_COMMAND_V2_CAL)
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (lcd_commands_type == LcdCommands::Layer1Cal)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		char cmd1[30];
 |  |  		char cmd1[30];
 | 
												
													
														
															|  |  		static uint8_t filament = 0;
 |  |  		static uint8_t filament = 0;
 | 
												
													
														
															|  | -		float width = 0.4;
 |  | 
 | 
												
													
														
															|  | -		float length = 20 - width;
 |  | 
 | 
												
													
														
															|  | -		float extr = count_e(0.2, width, length);
 |  | 
 | 
												
													
														
															|  | -		float extr_short_segment = count_e(0.2, width, width);
 |  | 
 | 
												
													
														
															|  | -		if(lcd_commands_step>1) lcd_timeoutToStatus.start(); //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -		if (lcd_commands_step == 0 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_step = 10;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -		if (lcd_commands_step == 20 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -            filament = 0;
 |  | 
 | 
												
													
														
															|  | -            lcd_commands_step = 10;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -        if (lcd_commands_step == 21 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -        {
 |  | 
 | 
												
													
														
															|  | -            filament = 1;
 |  | 
 | 
												
													
														
															|  | -            lcd_commands_step = 10;
 |  | 
 | 
												
													
														
															|  | -        }
 |  | 
 | 
												
													
														
															|  | -        if (lcd_commands_step == 22 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -        {
 |  | 
 | 
												
													
														
															|  | -            filament = 2;
 |  | 
 | 
												
													
														
															|  | -            lcd_commands_step = 10;
 |  | 
 | 
												
													
														
															|  | -        }
 |  | 
 | 
												
													
														
															|  | -        if (lcd_commands_step == 23 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -        {
 |  | 
 | 
												
													
														
															|  | -            filament = 3;
 |  | 
 | 
												
													
														
															|  | -            lcd_commands_step = 10;
 |  | 
 | 
												
													
														
															|  | -        }
 |  | 
 | 
												
													
														
															|  | -        if (lcd_commands_step == 24 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -        {
 |  | 
 | 
												
													
														
															|  | -            filament = 4;
 |  | 
 | 
												
													
														
															|  | -            lcd_commands_step = 10;
 |  | 
 | 
												
													
														
															|  | -        }
 |  | 
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -		if (lcd_commands_step == 10)
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M107"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M104 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP)));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M140 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP)));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M190 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP)));
 |  | 
 | 
												
													
														
															|  | -            enquecommand_P(PSTR("M109 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP)));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(_T(MSG_M117_V2_CALIBRATION));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G28"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G92 E0.0"));
 |  | 
 | 
												
													
														
															|  | 
 |  | +		if(lcd_commands_step>1) lcd_timeoutToStatus.start(); //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -            lcd_commands_step = 9;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -        if (lcd_commands_step == 9 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | 
 |  | +        if (!blocks_queued() && cmd_buffer_empty())
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
													
														
															|  | -            lcd_clear();
 |  | 
 | 
												
													
														
															|  | -            menu_depth = 0;
 |  | 
 | 
												
													
														
															|  | -            menu_submenu(lcd_babystep_z);
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -            if (mmu_enabled)
 |  | 
 | 
												
													
														
															|  | -            {
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("M83")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 Y-3.0 F1000.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 Z0.4 F1000.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                strcpy(cmd1, "T");
 |  | 
 | 
												
													
														
															|  | -                strcat(cmd1, itostr3left(filament));
 |  | 
 | 
												
													
														
															|  | -                enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 X55.0 E32.0 F1073.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 X5.0 E32.0 F1800.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 X55.0 E8.0 F2000.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 Z0.3 F1000.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G92 E0.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 X240.0 E25.0  F2200.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 Y-2.0 F1000.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 X55.0 E25 F1400.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 Z0.20 F1000.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 X5.0 E4.0 F1000.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -            } else
 |  | 
 | 
												
													
														
															|  | 
 |  | +            switch(lcd_commands_step)
 | 
												
													
														
															|  |              {
 |  |              {
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 X60.0 E9.0 F1000.0")); //intro line
 |  | 
 | 
												
													
														
															|  | -                enquecommand_P(PSTR("G1 X100.0 E12.5 F1000.0")); //intro line
 |  | 
 | 
												
													
														
															|  | 
 |  | +            case 0:
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 10;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 20:
 | 
												
													
														
															|  | 
 |  | +                filament = 0;
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 10;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 21:
 | 
												
													
														
															|  | 
 |  | +                filament = 1;
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 10;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 22:
 | 
												
													
														
															|  | 
 |  | +                filament = 2;
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 10;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 23:
 | 
												
													
														
															|  | 
 |  | +                filament = 3;
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 10;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 24:
 | 
												
													
														
															|  | 
 |  | +                filament = 4;
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 10;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 10:
 | 
												
													
														
															|  | 
 |  | +                lay1cal_preheat();
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 9;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 9:
 | 
												
													
														
															|  | 
 |  | +                lcd_clear();
 | 
												
													
														
															|  | 
 |  | +                menu_depth = 0;
 | 
												
													
														
															|  | 
 |  | +                menu_submenu(lcd_babystep_z);
 | 
												
													
														
															|  | 
 |  | +                lay1cal_intro_line(cmd1, filament);
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 8;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 8:
 | 
												
													
														
															|  | 
 |  | +                lay1cal_before_meander();
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 7;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 7:
 | 
												
													
														
															|  | 
 |  | +                lay1cal_meander(cmd1);
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 6;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 6:
 | 
												
													
														
															|  | 
 |  | +                for (uint8_t i = 0; i < 4; i++)
 | 
												
													
														
															|  | 
 |  | +                {
 | 
												
													
														
															|  | 
 |  | +                    lay1cal_square(cmd1, i);
 | 
												
													
														
															|  | 
 |  | +                }
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 5;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 5:
 | 
												
													
														
															|  | 
 |  | +                for (uint8_t i = 4; i < 8; i++)
 | 
												
													
														
															|  | 
 |  | +                {
 | 
												
													
														
															|  | 
 |  | +                    lay1cal_square(cmd1, i);
 | 
												
													
														
															|  | 
 |  | +                }
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 4;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 4:
 | 
												
													
														
															|  | 
 |  | +                for (uint8_t i = 8; i < 12; i++)
 | 
												
													
														
															|  | 
 |  | +                {
 | 
												
													
														
															|  | 
 |  | +                    lay1cal_square(cmd1, i);
 | 
												
													
														
															|  | 
 |  | +                }
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 3;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 3:
 | 
												
													
														
															|  | 
 |  | +                for (uint8_t i = 12; i < 16; i++)
 | 
												
													
														
															|  | 
 |  | +                {
 | 
												
													
														
															|  | 
 |  | +                    lay1cal_square(cmd1, i);
 | 
												
													
														
															|  | 
 |  | +                }
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 2;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 2:
 | 
												
													
														
															|  | 
 |  | +                enquecommand_P(PSTR("M107")); //turn off printer fan
 | 
												
													
														
															|  | 
 |  | +                enquecommand_P(PSTR("G1 E-0.07500 F2100.00000")); //retract
 | 
												
													
														
															|  | 
 |  | +                enquecommand_P(PSTR("M104 S0")); // turn off temperature
 | 
												
													
														
															|  | 
 |  | +                enquecommand_P(PSTR("M140 S0")); // turn off heatbed
 | 
												
													
														
															|  | 
 |  | +                enquecommand_P(PSTR("G1 Z10 F1300.000")); //lift Z
 | 
												
													
														
															|  | 
 |  | +                enquecommand_P(PSTR("G1 X10 Y180 F4000")); //Go to parking position
 | 
												
													
														
															|  | 
 |  | +                if (mmu_enabled) enquecommand_P(PSTR("M702 C")); //unload from nozzle
 | 
												
													
														
															|  | 
 |  | +                enquecommand_P(PSTR("M84"));// disable motors
 | 
												
													
														
															|  | 
 |  | +                forceMenuExpire = true; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 1;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            case 1:
 | 
												
													
														
															|  | 
 |  | +                lcd_setstatuspgm(_T(WELCOME_MSG));
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_step = 0;
 | 
												
													
														
															|  | 
 |  | +                lcd_commands_type = LcdCommands::Idle;
 | 
												
													
														
															|  | 
 |  | +                if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1)
 | 
												
													
														
															|  | 
 |  | +                {
 | 
												
													
														
															|  | 
 |  | +                    lcd_wizard(WizState::RepeatLay1Cal);
 | 
												
													
														
															|  | 
 |  | +                }
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -            lcd_commands_step = 8;
 |  | 
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | -		if (lcd_commands_step == 8 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G92 E0.0"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G21")); //set units to millimeters
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G90")); //use absolute coordinates
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M83")); //use relative distances for extrusion
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 E-1.50000 F2100.00000"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 Z5 F7200.000"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M204 S1000")); //set acceleration
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 F4000"));
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_step = 7;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -		if (lcd_commands_step == 7 && !blocks_queued() && cmd_buffer_empty()) //draw meander
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -			lcd_timeoutToStatus.start();
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			//just opposite direction
 |  | 
 | 
												
													
														
															|  | -			/*enquecommand_P(PSTR("G1 X50 Y55"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 F1080"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y55 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y75 E0.49386"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y75 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y95 E0.49386"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y95 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y115 E0.49386"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y115 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y135 E0.49386"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y135 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y155 E0.66174"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X100 Y155 E2.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X75 Y155 E2"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y155 E2.5"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 E - 0.07500 F2100.00000"));*/
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y155"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 Z0.150 F7200.000"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 F1080"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X75 Y155 E2.5"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X100 Y155 E2"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y155 E2.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y135 E0.66174"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y135 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y115 E0.49386"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y115 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y95 E0.49386"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y95 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y75 E0.49386"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y75 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X200 Y55 E0.49386"));
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X50 Y55 E3.62773"));
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			strcpy(cmd1, "G1 X50 Y35 E");
 |  | 
 | 
												
													
														
															|  | -			strcat(cmd1, ftostr43(extr));
 |  | 
 | 
												
													
														
															|  | -			enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_step = 6;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -		if (lcd_commands_step == 6 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			lcd_timeoutToStatus.start();
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			for (int i = 0; i < 4; i++) {
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 X70 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - i*width * 2));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (2 * i + 1)*width));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr_short_segment));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 X50 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (2 * i + 1)*width));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (i + 1)*width * 2));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr_short_segment));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -			}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_step = 5;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -		if (lcd_commands_step == 5 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -			lcd_timeoutToStatus.start();
 |  | 
 | 
												
													
														
															|  | -			for (int i = 4; i < 8; i++) {
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 X70 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - i*width * 2));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (2 * i + 1)*width));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr_short_segment));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 X50 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (2 * i + 1)*width));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (i + 1)*width * 2));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr_short_segment));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -			}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_step = 4;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -		if (lcd_commands_step == 4 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -			lcd_timeoutToStatus.start();
 |  | 
 | 
												
													
														
															|  | -			for (int i = 8; i < 12; i++) {
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 X70 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - i*width * 2));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (2 * i + 1)*width));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr_short_segment));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 X50 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (2 * i + 1)*width));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (i + 1)*width * 2));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr_short_segment));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -			}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_step = 3;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -		if (lcd_commands_step == 3 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -			lcd_timeoutToStatus.start();
 |  | 
 | 
												
													
														
															|  | -			for (int i = 12; i < 16; i++) {
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 X70 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - i*width * 2));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (2 * i + 1)*width));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr_short_segment));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 X50 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (2 * i + 1)*width));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -				strcpy(cmd1, "G1 Y");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr32(35 - (i + 1)*width * 2));
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, " E");
 |  | 
 | 
												
													
														
															|  | -				strcat(cmd1, ftostr43(extr_short_segment));
 |  | 
 | 
												
													
														
															|  | -				enquecommand(cmd1);
 |  | 
 | 
												
													
														
															|  | -			}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_step = 2;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -		if (lcd_commands_step == 2 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -			lcd_timeoutToStatus.start();
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M107")); //turn off printer fan			
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 E-0.07500 F2100.00000")); //retract
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M104 S0")); // turn off temperature
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M140 S0")); // turn off heatbed
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 Z10 F1300.000")); //lift Z
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("G1 X10 Y180 F4000")); //Go to parking position
 |  | 
 | 
												
													
														
															|  | -			if (mmu_enabled) enquecommand_P(PSTR("M702 C")); //unload from nozzle
 |  | 
 | 
												
													
														
															|  | -			enquecommand_P(PSTR("M84"));// disable motors
 |  | 
 | 
												
													
														
															|  | -			forceMenuExpire = true; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_step = 1;
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -		if (lcd_commands_step == 1 && !blocks_queued() && cmd_buffer_empty())
 |  | 
 | 
												
													
														
															|  | -		{
 |  | 
 | 
												
													
														
															|  | -			lcd_setstatuspgm(_T(WELCOME_MSG));
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_step = 0;
 |  | 
 | 
												
													
														
															|  | -			lcd_commands_type = 0;			
 |  | 
 | 
												
													
														
															|  | -			if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) {
 |  | 
 | 
												
													
														
															|  | -				lcd_wizard(WizState::RepeatLay1Cal);
 |  | 
 | 
												
													
														
															|  | -			}
 |  | 
 | 
												
													
														
															|  | -		}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  #endif // not SNMM
 |  |  #endif // not SNMM
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -	if (lcd_commands_type == LCD_COMMAND_STOP_PRINT)   /// stop print
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (lcd_commands_type == LcdCommands::StopPrint)   /// stop print
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -1645,9 +1466,9 @@ void lcd_commands()
 | 
												
													
														
															|  |  		if (lcd_commands_step == 1 && !blocks_queued())
 |  |  		if (lcd_commands_step == 1 && !blocks_queued())
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  |  			lcd_commands_step = 0;
 |  |  			lcd_commands_step = 0;
 | 
												
													
														
															|  | -			lcd_commands_type = 0;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_commands_type = LcdCommands::Idle;
 | 
												
													
														
															|  |  			lcd_setstatuspgm(_T(WELCOME_MSG));
 |  |  			lcd_setstatuspgm(_T(WELCOME_MSG));
 | 
												
													
														
															|  | -			custom_message_type = CUSTOM_MSG_TYPE_STATUS;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			custom_message_type = CustomMsg::Status;
 | 
												
													
														
															|  |  			isPrintPaused = false;
 |  |  			isPrintPaused = false;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		if (lcd_commands_step == 2 && !blocks_queued())
 |  |  		if (lcd_commands_step == 2 && !blocks_queued())
 | 
												
											
												
													
														
															|  | @@ -1703,7 +1524,7 @@ void lcd_commands()
 | 
												
													
														
															|  |  			if (mmu_enabled)
 |  |  			if (mmu_enabled)
 | 
												
													
														
															|  |  				setAllTargetHotends(0);
 |  |  				setAllTargetHotends(0);
 | 
												
													
														
															|  |  			manage_heater();
 |  |  			manage_heater();
 | 
												
													
														
															|  | -			custom_message_type = CUSTOM_MSG_TYPE_F_LOAD;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			custom_message_type = CustomMsg::FilamentLoading;
 | 
												
													
														
															|  |  			lcd_commands_step = 5;
 |  |  			lcd_commands_step = 5;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		if (lcd_commands_step == 7 && !blocks_queued())
 |  |  		if (lcd_commands_step == 7 && !blocks_queued())
 | 
												
											
												
													
														
															|  | @@ -1725,12 +1546,7 @@ void lcd_commands()
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -	if (lcd_commands_type == 3)
 |  | 
 | 
												
													
														
															|  | -	{
 |  | 
 | 
												
													
														
															|  | -		lcd_commands_type = 0;
 |  | 
 | 
												
													
														
															|  | -	}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -	if (lcd_commands_type == LCD_COMMAND_FARM_MODE_CONFIRM)   /// farm mode confirm
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (lcd_commands_type == LcdCommands::FarmModeConfirm)   /// farm mode confirm
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  		if (lcd_commands_step == 0) { lcd_commands_step = 6; }
 |  |  		if (lcd_commands_step == 0) { lcd_commands_step = 6; }
 | 
												
											
												
													
														
															|  | @@ -1739,7 +1555,7 @@ void lcd_commands()
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  |  			lcd_confirm_print();
 |  |  			lcd_confirm_print();
 | 
												
													
														
															|  |  			lcd_commands_step = 0;
 |  |  			lcd_commands_step = 0;
 | 
												
													
														
															|  | -			lcd_commands_type = 0;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_commands_type = LcdCommands::Idle;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		if (lcd_commands_step == 2 && !blocks_queued())
 |  |  		if (lcd_commands_step == 2 && !blocks_queued())
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
											
												
													
														
															|  | @@ -1772,11 +1588,11 @@ void lcd_commands()
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | -	if (lcd_commands_type == LCD_COMMAND_PID_EXTRUDER) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (lcd_commands_type == LcdCommands::PidExtruder) {
 | 
												
													
														
															|  |  		char cmd1[30];
 |  |  		char cmd1[30];
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  |  		if (lcd_commands_step == 0) {
 |  |  		if (lcd_commands_step == 0) {
 | 
												
													
														
															|  | -			custom_message_type = CUSTOM_MSG_TYPE_PIDCAL;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			custom_message_type = CustomMsg::PidCal;
 | 
												
													
														
															|  |  			custom_message_state = 1;
 |  |  			custom_message_state = 1;
 | 
												
													
														
															|  |  			lcd_draw_update = 3;
 |  |  			lcd_draw_update = 3;
 | 
												
													
														
															|  |  			lcd_commands_step = 3;
 |  |  			lcd_commands_step = 3;
 | 
												
											
												
													
														
															|  | @@ -1812,28 +1628,22 @@ void lcd_commands()
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		if ((lcd_commands_step == 1) && ((_millis()- display_time)>2000)) { //calibration finished message
 |  |  		if ((lcd_commands_step == 1) && ((_millis()- display_time)>2000)) { //calibration finished message
 | 
												
													
														
															|  |  			lcd_setstatuspgm(_T(WELCOME_MSG));
 |  |  			lcd_setstatuspgm(_T(WELCOME_MSG));
 | 
												
													
														
															|  | -			custom_message_type = CUSTOM_MSG_TYPE_STATUS;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			custom_message_type = CustomMsg::Status;
 | 
												
													
														
															|  |  			pid_temp = DEFAULT_PID_TEMP;
 |  |  			pid_temp = DEFAULT_PID_TEMP;
 | 
												
													
														
															|  |  			lcd_commands_step = 0;
 |  |  			lcd_commands_step = 0;
 | 
												
													
														
															|  | -			lcd_commands_type = 0;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_commands_type = LcdCommands::Idle;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -static float count_e(float layer_heigth, float extrusion_width, float extrusion_length) {
 |  | 
 | 
												
													
														
															|  | -	//returns filament length in mm which needs to be extrude to form line with extrusion_length * extrusion_width * layer heigth dimensions
 |  | 
 | 
												
													
														
															|  | -	float extr = extrusion_length * layer_heigth * extrusion_width / (M_PI * pow(1.75, 2) / 4);
 |  | 
 | 
												
													
														
															|  | -	return extr;
 |  | 
 | 
												
													
														
															|  | -}
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  |  void lcd_return_to_status()
 |  |  void lcd_return_to_status()
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  |  	lcd_refresh(); // to maybe revive the LCD if static electricity killed it.
 |  |  	lcd_refresh(); // to maybe revive the LCD if static electricity killed it.
 | 
												
													
														
															|  |  	menu_goto(lcd_status_screen, 0, false, true);
 |  |  	menu_goto(lcd_status_screen, 0, false, true);
 | 
												
													
														
															|  |  	menu_depth = 0;
 |  |  	menu_depth = 0;
 | 
												
													
														
															|  | -     eFilamentAction=e_FILAMENT_ACTION_none; // i.e. non-autoLoad
 |  | 
 | 
												
													
														
															|  | 
 |  | +     eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  //! @brief Pause print, disable nozzle heater, move to park position
 |  |  //! @brief Pause print, disable nozzle heater, move to park position
 | 
												
											
												
													
														
															|  | @@ -1843,9 +1653,9 @@ void lcd_pause_print()
 | 
												
													
														
															|  |      stop_and_save_print_to_ram(0.0,0.0);
 |  |      stop_and_save_print_to_ram(0.0,0.0);
 | 
												
													
														
															|  |      setAllTargetHotends(0);
 |  |      setAllTargetHotends(0);
 | 
												
													
														
															|  |      isPrintPaused = true;
 |  |      isPrintPaused = true;
 | 
												
													
														
															|  | -    if (LCD_COMMAND_IDLE == lcd_commands_type)
 |  | 
 | 
												
													
														
															|  | 
 |  | +    if (LcdCommands::Idle == lcd_commands_type)
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | -        lcd_commands_type = LCD_COMMAND_LONG_PAUSE;
 |  | 
 | 
												
													
														
															|  | 
 |  | +        lcd_commands_type = LcdCommands::LongPause;
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -1986,7 +1796,7 @@ void lcd_menu_extruder_info()                     // NOT static due to using ins
 | 
												
													
														
															|  |  			lcd_puts_P(_N("Filament sensor\n" "is disabled."));
 |  |  			lcd_puts_P(_N("Filament sensor\n" "is disabled."));
 | 
												
													
														
															|  |  		else
 |  |  		else
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  | -			if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL))
 |  | 
 | 
												
													
														
															|  | 
 |  | +			if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal))
 | 
												
													
														
															|  |  				pat9125_update();
 |  |  				pat9125_update();
 | 
												
													
														
															|  |  			lcd_printf_P(_N(
 |  |  			lcd_printf_P(_N(
 | 
												
													
														
															|  |  				"Fil. Xd:%3d Yd:%3d\n"
 |  |  				"Fil. Xd:%3d Yd:%3d\n"
 | 
												
											
												
													
														
															|  | @@ -2211,7 +2021,6 @@ static void lcd_preheat_menu()
 | 
												
													
														
															|  |  	  MENU_ITEM_FUNCTION_P(PSTR("farm   -  " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), lcd_preheat_farm);
 |  |  	  MENU_ITEM_FUNCTION_P(PSTR("farm   -  " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), lcd_preheat_farm);
 | 
												
													
														
															|  |  	  MENU_ITEM_FUNCTION_P(PSTR("nozzle -  " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), lcd_preheat_farm_nozzle);
 |  |  	  MENU_ITEM_FUNCTION_P(PSTR("nozzle -  " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), lcd_preheat_farm_nozzle);
 | 
												
													
														
															|  |  	  MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown);
 |  |  	  MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown);
 | 
												
													
														
															|  | -	  MENU_ITEM_FUNCTION_P(PSTR("ABS    -  " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)), lcd_preheat_abs);
 |  | 
 | 
												
													
														
															|  |    } else {
 |  |    } else {
 | 
												
													
														
															|  |  	  MENU_ITEM_FUNCTION_P(PSTR("PLA  -  " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)), lcd_preheat_pla);
 |  |  	  MENU_ITEM_FUNCTION_P(PSTR("PLA  -  " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)), lcd_preheat_pla);
 | 
												
													
														
															|  |  	  MENU_ITEM_FUNCTION_P(PSTR("PET  -  " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)), lcd_preheat_pet);
 |  |  	  MENU_ITEM_FUNCTION_P(PSTR("PET  -  " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)), lcd_preheat_pet);
 | 
												
											
												
													
														
															|  | @@ -2342,13 +2151,22 @@ void lcd_set_fan_check() {
 | 
												
													
														
															|  |  #ifdef MMU_HAS_CUTTER
 |  |  #ifdef MMU_HAS_CUTTER
 | 
												
													
														
															|  |  void lcd_cutter_enabled()
 |  |  void lcd_cutter_enabled()
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  | -    if (1 == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
 |  | 
 | 
												
													
														
															|  | 
 |  | +    if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | 
 |  | +#ifndef MMU_ALWAYS_CUT
 | 
												
													
														
															|  |          eeprom_update_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0);
 |  |          eeprom_update_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0);
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  | 
 |  | +#else //MMU_ALWAYS_CUT
 | 
												
													
														
															|  | 
 |  | +        eeprom_update_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, EEPROM_MMU_CUTTER_ENABLED_always);
 | 
												
													
														
															|  | 
 |  | +    }
 | 
												
													
														
															|  | 
 |  | +    else if (EEPROM_MMU_CUTTER_ENABLED_always == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
 | 
												
													
														
															|  | 
 |  | +    {
 | 
												
													
														
															|  | 
 |  | +        eeprom_update_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0);
 | 
												
													
														
															|  | 
 |  | +    }
 | 
												
													
														
															|  | 
 |  | +#endif //MMU_ALWAYS_CUT
 | 
												
													
														
															|  |      else
 |  |      else
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | -        eeprom_update_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 1);
 |  | 
 | 
												
													
														
															|  | 
 |  | +        eeprom_update_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, EEPROM_MMU_CUTTER_ENABLED_enabled);
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  #endif //MMU_HAS_CUTTER
 |  |  #endif //MMU_HAS_CUTTER
 | 
												
											
												
													
														
															|  | @@ -2363,7 +2181,7 @@ void lcd_set_filament_oq_meass()
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -eFILAMENT_ACTION eFilamentAction=e_FILAMENT_ACTION_none; // must be initialized as 'non-autoLoad'
 |  | 
 | 
												
													
														
															|  | 
 |  | +FilamentAction eFilamentAction=FilamentAction::None; // must be initialized as 'non-autoLoad'
 | 
												
													
														
															|  |  bool bFilamentFirstRun;
 |  |  bool bFilamentFirstRun;
 | 
												
													
														
															|  |  bool bFilamentPreheatState;
 |  |  bool bFilamentPreheatState;
 | 
												
													
														
															|  |  bool bFilamentAction=false;
 |  |  bool bFilamentAction=false;
 | 
												
											
												
													
														
															|  | @@ -2380,18 +2198,18 @@ lcd_puts_P(_i("Press the knob"));                 ////MSG_ c=20 r=1
 | 
												
													
														
															|  |  lcd_set_cursor(0,3);
 |  |  lcd_set_cursor(0,3);
 | 
												
													
														
															|  |  switch(eFilamentAction)
 |  |  switch(eFilamentAction)
 | 
												
													
														
															|  |       {
 |  |       {
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_Load:
 |  | 
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_autoLoad:
 |  | 
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_mmuLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +     case FilamentAction::Load:
 | 
												
													
														
															|  | 
 |  | +     case FilamentAction::AutoLoad:
 | 
												
													
														
															|  | 
 |  | +     case FilamentAction::MmuLoad:
 | 
												
													
														
															|  |            lcd_puts_P(_i("to load filament"));     ////MSG_ c=20 r=1
 |  |            lcd_puts_P(_i("to load filament"));     ////MSG_ c=20 r=1
 | 
												
													
														
															|  |            break;
 |  |            break;
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_unLoad:
 |  | 
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_mmuUnLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +     case FilamentAction::UnLoad:
 | 
												
													
														
															|  | 
 |  | +     case FilamentAction::MmuUnLoad:
 | 
												
													
														
															|  |            lcd_puts_P(_i("to unload filament"));   ////MSG_ c=20 r=1
 |  |            lcd_puts_P(_i("to unload filament"));   ////MSG_ c=20 r=1
 | 
												
													
														
															|  |            break;
 |  |            break;
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_mmuEject:
 |  | 
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_mmuCut:
 |  | 
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_none:
 |  | 
 | 
												
													
														
															|  | 
 |  | +     case FilamentAction::MmuEject:
 | 
												
													
														
															|  | 
 |  | +     case FilamentAction::MmuCut:
 | 
												
													
														
															|  | 
 |  | +     case FilamentAction::None:
 | 
												
													
														
															|  |            break;
 |  |            break;
 | 
												
													
														
															|  |       }
 |  |       }
 | 
												
													
														
															|  |  if(lcd_clicked())
 |  |  if(lcd_clicked())
 | 
												
											
												
													
														
															|  | @@ -2405,21 +2223,21 @@ if(lcd_clicked())
 | 
												
													
														
															|  |       menu_back(nLevel);
 |  |       menu_back(nLevel);
 | 
												
													
														
															|  |       switch(eFilamentAction)
 |  |       switch(eFilamentAction)
 | 
												
													
														
															|  |            {
 |  |            {
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_autoLoad:
 |  | 
 | 
												
													
														
															|  | -               eFilamentAction=e_FILAMENT_ACTION_none; // i.e. non-autoLoad
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::AutoLoad:
 | 
												
													
														
															|  | 
 |  | +               eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
 | 
												
													
														
															|  |                 // no break
 |  |                 // no break
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_Load:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::Load:
 | 
												
													
														
															|  |                 loading_flag=true;
 |  |                 loading_flag=true;
 | 
												
													
														
															|  |                 enquecommand_P(PSTR("M701"));      // load filament
 |  |                 enquecommand_P(PSTR("M701"));      // load filament
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_unLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::UnLoad:
 | 
												
													
														
															|  |                 enquecommand_P(PSTR("M702"));      // unload filament
 |  |                 enquecommand_P(PSTR("M702"));      // unload filament
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuLoad:
 |  | 
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuUnLoad:
 |  | 
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuEject:
 |  | 
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuCut:
 |  | 
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_none:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuLoad:
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuUnLoad:
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuEject:
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuCut:
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::None:
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  |            }
 |  |            }
 | 
												
													
														
															|  |       }
 |  |       }
 | 
												
											
												
													
														
															|  | @@ -2443,19 +2261,19 @@ lcdui_print_temp(LCD_STR_THERMOMETER[0],(int)degHotend(0),(int)degTargetHotend(0
 | 
												
													
														
															|  |  lcd_set_cursor(0,1);
 |  |  lcd_set_cursor(0,1);
 | 
												
													
														
															|  |  switch(eFilamentAction)
 |  |  switch(eFilamentAction)
 | 
												
													
														
															|  |       {
 |  |       {
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_Load:
 |  | 
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_autoLoad:
 |  | 
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_mmuLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +     case eFILAMENT_ACTION::load:
 | 
												
													
														
															|  | 
 |  | +     case eFILAMENT_ACTION::autoLoad:
 | 
												
													
														
															|  | 
 |  | +     case eFILAMENT_ACTION::mmuLoad:
 | 
												
													
														
															|  |            lcd_puts_P(_i("Preheating to load"));   ////MSG_ c=20 r=1
 |  |            lcd_puts_P(_i("Preheating to load"));   ////MSG_ c=20 r=1
 | 
												
													
														
															|  |            break;
 |  |            break;
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_unLoad:
 |  | 
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_mmuUnLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +     case eFILAMENT_ACTION::unLoad:
 | 
												
													
														
															|  | 
 |  | +     case eFILAMENT_ACTION::mmuUnLoad:
 | 
												
													
														
															|  |            lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
 |  |            lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
 | 
												
													
														
															|  |            break;
 |  |            break;
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_mmuEject:
 |  | 
 | 
												
													
														
															|  | 
 |  | +     case eFILAMENT_ACTION::mmuEject:
 | 
												
													
														
															|  |            lcd_puts_P(_i("Preheating to eject"));  ////MSG_ c=20 r=1
 |  |            lcd_puts_P(_i("Preheating to eject"));  ////MSG_ c=20 r=1
 | 
												
													
														
															|  |            break;
 |  |            break;
 | 
												
													
														
															|  | -     case e_FILAMENT_ACTION_mmuCut:
 |  | 
 | 
												
													
														
															|  | 
 |  | +     case eFILAMENT_ACTION::mmuCut:
 | 
												
													
														
															|  |            lcd_puts_P(_i("Preheating to cut"));  ////MSG_ c=20 r=1
 |  |            lcd_puts_P(_i("Preheating to cut"));  ////MSG_ c=20 r=1
 | 
												
													
														
															|  |            break;
 |  |            break;
 | 
												
													
														
															|  |       }
 |  |       }
 | 
												
											
												
													
														
															|  | @@ -2474,20 +2292,20 @@ if(lcd_clicked())
 | 
												
													
														
															|  |            setTargetBed((float)nTargetBedOld);
 |  |            setTargetBed((float)nTargetBedOld);
 | 
												
													
														
															|  |            }
 |  |            }
 | 
												
													
														
															|  |       menu_back();
 |  |       menu_back();
 | 
												
													
														
															|  | -     if(eFilamentAction==e_FILAMENT_ACTION_autoLoad)
 |  | 
 | 
												
													
														
															|  | -          eFilamentAction=e_FILAMENT_ACTION_none; // i.e. non-autoLoad
 |  | 
 | 
												
													
														
															|  | 
 |  | +     if(eFilamentAction==eFILAMENT_ACTION::autoLoad)
 | 
												
													
														
															|  | 
 |  | +          eFilamentAction=eFILAMENT_ACTION::none; // i.e. non-autoLoad
 | 
												
													
														
															|  |       }
 |  |       }
 | 
												
													
														
															|  |  else {
 |  |  else {
 | 
												
													
														
															|  |       if(current_temperature[0]>(target_temperature[0]*0.95))
 |  |       if(current_temperature[0]>(target_temperature[0]*0.95))
 | 
												
													
														
															|  |            {
 |  |            {
 | 
												
													
														
															|  |            switch(eFilamentAction)
 |  |            switch(eFilamentAction)
 | 
												
													
														
															|  |                 {
 |  |                 {
 | 
												
													
														
															|  | -               case e_FILAMENT_ACTION_Load:
 |  | 
 | 
												
													
														
															|  | -               case e_FILAMENT_ACTION_autoLoad:
 |  | 
 | 
												
													
														
															|  | -               case e_FILAMENT_ACTION_unLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +               case eFILAMENT_ACTION::load:
 | 
												
													
														
															|  | 
 |  | +               case eFILAMENT_ACTION::autoLoad:
 | 
												
													
														
															|  | 
 |  | +               case eFILAMENT_ACTION::unLoad:
 | 
												
													
														
															|  |                      menu_submenu(mFilamentPrompt);
 |  |                      menu_submenu(mFilamentPrompt);
 | 
												
													
														
															|  |                      break;
 |  |                      break;
 | 
												
													
														
															|  | -               case e_FILAMENT_ACTION_mmuLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +               case eFILAMENT_ACTION::mmuLoad:
 | 
												
													
														
															|  |                      nLevel=1;
 |  |                      nLevel=1;
 | 
												
													
														
															|  |                      if(!bFilamentPreheatState)
 |  |                      if(!bFilamentPreheatState)
 | 
												
													
														
															|  |                           nLevel++;
 |  |                           nLevel++;
 | 
												
											
												
													
														
															|  | @@ -2495,7 +2313,7 @@ else {
 | 
												
													
														
															|  |                      menu_back(nLevel);
 |  |                      menu_back(nLevel);
 | 
												
													
														
															|  |                      menu_submenu(mmu_load_to_nozzle_menu);
 |  |                      menu_submenu(mmu_load_to_nozzle_menu);
 | 
												
													
														
															|  |                      break;
 |  |                      break;
 | 
												
													
														
															|  | -               case e_FILAMENT_ACTION_mmuUnLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +               case eFILAMENT_ACTION::mmuUnLoad:
 | 
												
													
														
															|  |                      nLevel=1;
 |  |                      nLevel=1;
 | 
												
													
														
															|  |                      if(!bFilamentPreheatState)
 |  |                      if(!bFilamentPreheatState)
 | 
												
													
														
															|  |                           nLevel++;
 |  |                           nLevel++;
 | 
												
											
												
													
														
															|  | @@ -2503,7 +2321,7 @@ else {
 | 
												
													
														
															|  |                      menu_back(nLevel);
 |  |                      menu_back(nLevel);
 | 
												
													
														
															|  |                      extr_unload();
 |  |                      extr_unload();
 | 
												
													
														
															|  |                      break;
 |  |                      break;
 | 
												
													
														
															|  | -               case e_FILAMENT_ACTION_mmuEject:
 |  | 
 | 
												
													
														
															|  | 
 |  | +               case eFILAMENT_ACTION::mmuEject:
 | 
												
													
														
															|  |                      nLevel=1;
 |  |                      nLevel=1;
 | 
												
													
														
															|  |                      if(!bFilamentPreheatState)
 |  |                      if(!bFilamentPreheatState)
 | 
												
													
														
															|  |                           nLevel++;
 |  |                           nLevel++;
 | 
												
											
												
													
														
															|  | @@ -2511,7 +2329,7 @@ else {
 | 
												
													
														
															|  |                      menu_back(nLevel);
 |  |                      menu_back(nLevel);
 | 
												
													
														
															|  |                      menu_submenu(mmu_fil_eject_menu);
 |  |                      menu_submenu(mmu_fil_eject_menu);
 | 
												
													
														
															|  |                      break;
 |  |                      break;
 | 
												
													
														
															|  | -               case e_FILAMENT_ACTION_mmuCut:
 |  | 
 | 
												
													
														
															|  | 
 |  | +               case eFILAMENT_ACTION::mmuCut:
 | 
												
													
														
															|  |                      nLevel=1;
 |  |                      nLevel=1;
 | 
												
													
														
															|  |                      if(!bFilamentPreheatState)
 |  |                      if(!bFilamentPreheatState)
 | 
												
													
														
															|  |                           nLevel++;
 |  |                           nLevel++;
 | 
												
											
												
													
														
															|  | @@ -2544,44 +2362,44 @@ if(current_temperature[0]>(target_temperature[0]*0.95))
 | 
												
													
														
															|  |       {
 |  |       {
 | 
												
													
														
															|  |       switch(eFilamentAction)
 |  |       switch(eFilamentAction)
 | 
												
													
														
															|  |            {
 |  |            {
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_Load:
 |  | 
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_autoLoad:
 |  | 
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_unLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::Load:
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::AutoLoad:
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::UnLoad:
 | 
												
													
														
															|  |                 if(bFilamentWaitingFlag)
 |  |                 if(bFilamentWaitingFlag)
 | 
												
													
														
															|  |                      menu_submenu(mFilamentPrompt);
 |  |                      menu_submenu(mFilamentPrompt);
 | 
												
													
														
															|  |                 else {
 |  |                 else {
 | 
												
													
														
															|  |                      nLevel=bFilamentPreheatState?1:2;
 |  |                      nLevel=bFilamentPreheatState?1:2;
 | 
												
													
														
															|  |                      menu_back(nLevel);
 |  |                      menu_back(nLevel);
 | 
												
													
														
															|  | -                    if((eFilamentAction==e_FILAMENT_ACTION_Load)||(eFilamentAction==e_FILAMENT_ACTION_autoLoad))
 |  | 
 | 
												
													
														
															|  | 
 |  | +                    if((eFilamentAction==FilamentAction::Load)||(eFilamentAction==FilamentAction::AutoLoad))
 | 
												
													
														
															|  |                           {
 |  |                           {
 | 
												
													
														
															|  |                           loading_flag=true;
 |  |                           loading_flag=true;
 | 
												
													
														
															|  |                           enquecommand_P(PSTR("M701")); // load filament
 |  |                           enquecommand_P(PSTR("M701")); // load filament
 | 
												
													
														
															|  | -                         if(eFilamentAction==e_FILAMENT_ACTION_autoLoad)
 |  | 
 | 
												
													
														
															|  | -                              eFilamentAction=e_FILAMENT_ACTION_none; // i.e. non-autoLoad
 |  | 
 | 
												
													
														
															|  | 
 |  | +                         if(eFilamentAction==FilamentAction::AutoLoad)
 | 
												
													
														
															|  | 
 |  | +                              eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
 | 
												
													
														
															|  |                           }
 |  |                           }
 | 
												
													
														
															|  | -                    if(eFilamentAction==e_FILAMENT_ACTION_unLoad)
 |  | 
 | 
												
													
														
															|  | 
 |  | +                    if(eFilamentAction==FilamentAction::UnLoad)
 | 
												
													
														
															|  |                           enquecommand_P(PSTR("M702")); // unload filament
 |  |                           enquecommand_P(PSTR("M702")); // unload filament
 | 
												
													
														
															|  |                      }
 |  |                      }
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuLoad:
 | 
												
													
														
															|  |                 nLevel=bFilamentPreheatState?1:2;
 |  |                 nLevel=bFilamentPreheatState?1:2;
 | 
												
													
														
															|  |                 bFilamentAction=true;
 |  |                 bFilamentAction=true;
 | 
												
													
														
															|  |                 menu_back(nLevel);
 |  |                 menu_back(nLevel);
 | 
												
													
														
															|  |                 menu_submenu(mmu_load_to_nozzle_menu);
 |  |                 menu_submenu(mmu_load_to_nozzle_menu);
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuUnLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuUnLoad:
 | 
												
													
														
															|  |                 nLevel=bFilamentPreheatState?1:2;
 |  |                 nLevel=bFilamentPreheatState?1:2;
 | 
												
													
														
															|  |                 bFilamentAction=true;
 |  |                 bFilamentAction=true;
 | 
												
													
														
															|  |                 menu_back(nLevel);
 |  |                 menu_back(nLevel);
 | 
												
													
														
															|  |                 extr_unload();
 |  |                 extr_unload();
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuEject:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuEject:
 | 
												
													
														
															|  |                 nLevel=bFilamentPreheatState?1:2;
 |  |                 nLevel=bFilamentPreheatState?1:2;
 | 
												
													
														
															|  |                 bFilamentAction=true;
 |  |                 bFilamentAction=true;
 | 
												
													
														
															|  |                 menu_back(nLevel);
 |  |                 menu_back(nLevel);
 | 
												
													
														
															|  |                 menu_submenu(mmu_fil_eject_menu);
 |  |                 menu_submenu(mmu_fil_eject_menu);
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuCut:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuCut:
 | 
												
													
														
															|  |  #ifdef MMU_HAS_CUTTER
 |  |  #ifdef MMU_HAS_CUTTER
 | 
												
													
														
															|  |                 nLevel=bFilamentPreheatState?1:2;
 |  |                 nLevel=bFilamentPreheatState?1:2;
 | 
												
													
														
															|  |                 bFilamentAction=true;
 |  |                 bFilamentAction=true;
 | 
												
											
												
													
														
															|  | @@ -2589,7 +2407,7 @@ if(current_temperature[0]>(target_temperature[0]*0.95))
 | 
												
													
														
															|  |                 menu_submenu(mmu_cut_filament_menu);
 |  |                 menu_submenu(mmu_cut_filament_menu);
 | 
												
													
														
															|  |  #endif //MMU_HAS_CUTTER
 |  |  #endif //MMU_HAS_CUTTER
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_none:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::None:
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  |            }
 |  |            }
 | 
												
													
														
															|  |       if(bFilamentWaitingFlag)
 |  |       if(bFilamentWaitingFlag)
 | 
												
											
												
													
														
															|  | @@ -2603,22 +2421,22 @@ else {
 | 
												
													
														
															|  |       lcd_set_cursor(0,1);
 |  |       lcd_set_cursor(0,1);
 | 
												
													
														
															|  |       switch(eFilamentAction)
 |  |       switch(eFilamentAction)
 | 
												
													
														
															|  |            {
 |  |            {
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_Load:
 |  | 
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_autoLoad:
 |  | 
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::Load:
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::AutoLoad:
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuLoad:
 | 
												
													
														
															|  |                 lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1
 |  |                 lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_unLoad:
 |  | 
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuUnLoad:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::UnLoad:
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuUnLoad:
 | 
												
													
														
															|  |                 lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
 |  |                 lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuEject:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuEject:
 | 
												
													
														
															|  |                 lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
 |  |                 lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_mmuCut:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::MmuCut:
 | 
												
													
														
															|  |                 lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
 |  |                 lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  | -          case e_FILAMENT_ACTION_none:
 |  | 
 | 
												
													
														
															|  | 
 |  | +          case FilamentAction::None:
 | 
												
													
														
															|  |                 break;
 |  |                 break;
 | 
												
													
														
															|  |            }
 |  |            }
 | 
												
													
														
															|  |       lcd_set_cursor(0,3);
 |  |       lcd_set_cursor(0,3);
 | 
												
											
												
													
														
															|  | @@ -2637,8 +2455,8 @@ else {
 | 
												
													
														
															|  |                 setTargetBed((float)nTargetBedOld);
 |  |                 setTargetBed((float)nTargetBedOld);
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |            menu_back();
 |  |            menu_back();
 | 
												
													
														
															|  | -          if(eFilamentAction==e_FILAMENT_ACTION_autoLoad)
 |  | 
 | 
												
													
														
															|  | -               eFilamentAction=e_FILAMENT_ACTION_none; // i.e. non-autoLoad
 |  | 
 | 
												
													
														
															|  | 
 |  | +          if(eFilamentAction==FilamentAction::AutoLoad)
 | 
												
													
														
															|  | 
 |  | +               eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
 | 
												
													
														
															|  |            }
 |  |            }
 | 
												
													
														
															|  |       }
 |  |       }
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
											
												
													
														
															|  | @@ -2683,8 +2501,8 @@ mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP,FLEX_PREHEAT_HPB_TEMP);
 | 
												
													
														
															|  |  void mFilamentBack()
 |  |  void mFilamentBack()
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  |  menu_back();
 |  |  menu_back();
 | 
												
													
														
															|  | -if(eFilamentAction==e_FILAMENT_ACTION_autoLoad)
 |  | 
 | 
												
													
														
															|  | -     eFilamentAction=e_FILAMENT_ACTION_none; // i.e. non-autoLoad
 |  | 
 | 
												
													
														
															|  | 
 |  | +if(eFilamentAction==FilamentAction::AutoLoad)
 | 
												
													
														
															|  | 
 |  | +     eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  void mFilamentMenu()
 |  |  void mFilamentMenu()
 | 
												
											
												
													
														
															|  | @@ -2715,7 +2533,7 @@ if(0)
 | 
												
													
														
															|  |       enquecommand_P(PSTR("M702"));                // unload filament
 |  |       enquecommand_P(PSTR("M702"));                // unload filament
 | 
												
													
														
															|  |       }
 |  |       }
 | 
												
													
														
															|  |  else {
 |  |  else {
 | 
												
													
														
															|  | -     eFilamentAction=e_FILAMENT_ACTION_unLoad;
 |  | 
 | 
												
													
														
															|  | 
 |  | +     eFilamentAction=FilamentAction::UnLoad;
 | 
												
													
														
															|  |       bFilamentFirstRun=false;
 |  |       bFilamentFirstRun=false;
 | 
												
													
														
															|  |       if(target_temperature[0]>=EXTRUDE_MINTEMP)
 |  |       if(target_temperature[0]>=EXTRUDE_MINTEMP)
 | 
												
													
														
															|  |            {
 |  |            {
 | 
												
											
												
													
														
															|  | @@ -2757,11 +2575,11 @@ void lcd_change_success() {
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 
 |  |  static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  | -	for (int i = 0; i < 20; i++) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +	for (uint_least8_t i = 0; i < 20; i++) {
 | 
												
													
														
															|  |  		lcd_set_cursor(i, 3);
 |  |  		lcd_set_cursor(i, 3);
 | 
												
													
														
															|  |  		lcd_print(".");
 |  |  		lcd_print(".");
 | 
												
													
														
															|  |  		//loading_time_ms/20 delay
 |  |  		//loading_time_ms/20 delay
 | 
												
													
														
															|  | -		for (int j = 0; j < 5; j++) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +		for (uint_least8_t j = 0; j < 5; j++) {
 | 
												
													
														
															|  |  			delay_keep_alive(loading_time_ms / 100);
 |  |  			delay_keep_alive(loading_time_ms / 100);
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
											
												
													
														
															|  | @@ -2945,7 +2763,7 @@ static void lcd_LoadFilament()
 | 
												
													
														
															|  |  if(0)
 |  |  if(0)
 | 
												
													
														
															|  |    {
 |  |    {
 | 
												
													
														
															|  |  //      menu_back();                                // not necessary (see "lcd_return_to_status()" below)
 |  |  //      menu_back();                                // not necessary (see "lcd_return_to_status()" below)
 | 
												
													
														
															|  | -      custom_message_type = CUSTOM_MSG_TYPE_F_LOAD;
 |  | 
 | 
												
													
														
															|  | 
 |  | +      custom_message_type = CustomMsg::FilamentLoading;
 | 
												
													
														
															|  |        loading_flag = true;
 |  |        loading_flag = true;
 | 
												
													
														
															|  |        enquecommand_P(PSTR("M701")); //load filament
 |  |        enquecommand_P(PSTR("M701")); //load filament
 | 
												
													
														
															|  |        SERIAL_ECHOLN("Loading filament");
 |  |        SERIAL_ECHOLN("Loading filament");
 | 
												
											
												
													
														
															|  | @@ -2953,7 +2771,7 @@ if(0)
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
													
														
															|  |    else
 |  |    else
 | 
												
													
														
															|  |    {
 |  |    {
 | 
												
													
														
															|  | -     eFilamentAction=e_FILAMENT_ACTION_Load;
 |  | 
 | 
												
													
														
															|  | 
 |  | +     eFilamentAction=FilamentAction::Load;
 | 
												
													
														
															|  |       bFilamentFirstRun=false;
 |  |       bFilamentFirstRun=false;
 | 
												
													
														
															|  |       if(target_temperature[0]>=EXTRUDE_MINTEMP)
 |  |       if(target_temperature[0]>=EXTRUDE_MINTEMP)
 | 
												
													
														
															|  |            {
 |  |            {
 | 
												
											
												
													
														
															|  | @@ -3206,7 +3024,7 @@ static void lcd_menu_xyz_offset()
 | 
												
													
														
															|  |      float cntr[2];
 |  |      float cntr[2];
 | 
												
													
														
															|  |      world2machine_read_valid(vec_x, vec_y, cntr);
 |  |      world2machine_read_valid(vec_x, vec_y, cntr);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -    for (int i = 0; i < 2; i++)
 |  | 
 | 
												
													
														
															|  | 
 |  | +    for (uint_least8_t i = 0; i < 2; i++)
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  |          lcd_puts_at_P(11, i + 2, PSTR(""));
 |  |          lcd_puts_at_P(11, i + 2, PSTR(""));
 | 
												
													
														
															|  |          lcd_print(cntr[i]);
 |  |          lcd_print(cntr[i]);
 | 
												
											
												
													
														
															|  | @@ -3402,7 +3220,7 @@ void pid_extruder()
 | 
												
													
														
															|  |  	lcd_set_cursor(1, 2);
 |  |  	lcd_set_cursor(1, 2);
 | 
												
													
														
															|  |  	lcd_print(ftostr3(pid_temp));
 |  |  	lcd_print(ftostr3(pid_temp));
 | 
												
													
														
															|  |  	if (lcd_clicked()) {
 |  |  	if (lcd_clicked()) {
 | 
												
													
														
															|  | -		lcd_commands_type = LCD_COMMAND_PID_EXTRUDER;
 |  | 
 | 
												
													
														
															|  | 
 |  | +		lcd_commands_type = LcdCommands::PidExtruder;
 | 
												
													
														
															|  |  		lcd_return_to_status();
 |  |  		lcd_return_to_status();
 | 
												
													
														
															|  |  		lcd_update(2);
 |  |  		lcd_update(2);
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
											
												
													
														
															|  | @@ -4012,7 +3830,7 @@ void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, ui
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  void lcd_temp_cal_show_result(bool result) {
 |  |  void lcd_temp_cal_show_result(bool result) {
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  | -	custom_message_type = CUSTOM_MSG_TYPE_STATUS;
 |  | 
 | 
												
													
														
															|  | 
 |  | +	custom_message_type = CustomMsg::Status;
 | 
												
													
														
															|  |  	disable_x();
 |  |  	disable_x();
 | 
												
													
														
															|  |  	disable_y();
 |  |  	disable_y();
 | 
												
													
														
															|  |  	disable_z();
 |  |  	disable_z();
 | 
												
											
												
													
														
															|  | @@ -4156,7 +3974,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
 | 
												
													
														
															|  |  			SERIAL_ECHOLN("}");
 |  |  			SERIAL_ECHOLN("}");
 | 
												
													
														
															|  |  			status_number = 14;
 |  |  			status_number = 14;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  | -		else if (IS_SD_PRINTING)
 |  | 
 | 
												
													
														
															|  | 
 |  | +		else if (IS_SD_PRINTING || loading_flag)
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  |  			SERIAL_ECHO("{");
 |  |  			SERIAL_ECHO("{");
 | 
												
													
														
															|  |  			prusa_stat_printerstatus(4);
 |  |  			prusa_stat_printerstatus(4);
 | 
												
											
												
													
														
															|  | @@ -4170,6 +3988,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
 | 
												
													
														
															|  |  			SERIAL_ECHO("{");
 |  |  			SERIAL_ECHO("{");
 | 
												
													
														
															|  |  			prusa_stat_printerstatus(1);
 |  |  			prusa_stat_printerstatus(1);
 | 
												
													
														
															|  |  			prusa_stat_farm_number();
 |  |  			prusa_stat_farm_number();
 | 
												
													
														
															|  | 
 |  | +			prusa_stat_diameter();
 | 
												
													
														
															|  |  			SERIAL_ECHOLN("}");
 |  |  			SERIAL_ECHOLN("}");
 | 
												
													
														
															|  |  			status_number = 1;
 |  |  			status_number = 1;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
											
												
													
														
															|  | @@ -4194,7 +4013,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
 | 
												
													
														
															|  |  		status_number = 3;
 |  |  		status_number = 3;
 | 
												
													
														
															|  |  		farm_timer = 1;
 |  |  		farm_timer = 1;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -		if (IS_SD_PRINTING)
 |  | 
 | 
												
													
														
															|  | 
 |  | +		if (IS_SD_PRINTING || loading_flag)
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  |  			farm_status = 4;
 |  |  			farm_status = 4;
 | 
												
													
														
															|  |  			SERIAL_ECHO("{");
 |  |  			SERIAL_ECHO("{");
 | 
												
											
												
													
														
															|  | @@ -4324,6 +4143,12 @@ static void prusa_stat_farm_number() {
 | 
												
													
														
															|  |  	SERIAL_ECHO("]");
 |  |  	SERIAL_ECHO("]");
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | 
 |  | +static void prusa_stat_diameter() {
 | 
												
													
														
															|  | 
 |  | +	SERIAL_ECHO("[DIA:");
 | 
												
													
														
															|  | 
 |  | +	SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM));
 | 
												
													
														
															|  | 
 |  | +	SERIAL_ECHO("]");
 | 
												
													
														
															|  | 
 |  | +}
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |  static void prusa_stat_temperatures()
 |  |  static void prusa_stat_temperatures()
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  |  	SERIAL_ECHO("[ST0:");
 |  |  	SERIAL_ECHO("[ST0:");
 | 
												
											
												
													
														
															|  | @@ -4359,6 +4184,7 @@ static void prusa_stat_printinfo()
 | 
												
													
														
															|  |  	SERIAL_ECHO("][FWR:");
 |  |  	SERIAL_ECHO("][FWR:");
 | 
												
													
														
															|  |  	SERIAL_ECHO(FW_VERSION);
 |  |  	SERIAL_ECHO(FW_VERSION);
 | 
												
													
														
															|  |  	SERIAL_ECHO("]");
 |  |  	SERIAL_ECHO("]");
 | 
												
													
														
															|  | 
 |  | +     prusa_stat_diameter();
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  /*
 |  |  /*
 | 
												
											
												
													
														
															|  | @@ -4633,7 +4459,7 @@ static void lcd_crash_mode_set()
 | 
												
													
														
															|  |      }else{
 |  |      }else{
 | 
												
													
														
															|  |          crashdet_enable();
 |  |          crashdet_enable();
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  | -	if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) menu_goto(lcd_tune_menu, 9, true, true);
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) menu_goto(lcd_tune_menu, 9, true, true);
 | 
												
													
														
															|  |  	else menu_goto(lcd_settings_menu, 9, true, true);
 |  |  	else menu_goto(lcd_settings_menu, 9, true, true);
 | 
												
													
														
															|  |      
 |  |      
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
											
												
													
														
															|  | @@ -4870,19 +4696,19 @@ void lcd_v2_calibration()
 | 
												
													
														
															|  |  	    if (filament < 5)
 |  |  	    if (filament < 5)
 | 
												
													
														
															|  |  	    {
 |  |  	    {
 | 
												
													
														
															|  |  	        lcd_commands_step = 20 + filament;
 |  |  	        lcd_commands_step = 20 + filament;
 | 
												
													
														
															|  | -	        lcd_commands_type = LCD_COMMAND_V2_CAL;
 |  | 
 | 
												
													
														
															|  | 
 |  | +	        lcd_commands_type = LcdCommands::Layer1Cal;
 | 
												
													
														
															|  |  	    }
 |  |  	    }
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	else
 |  |  	else
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		bool loaded = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is PLA filament loaded?"), false, true);////MSG_PLA_FILAMENT_LOADED c=20 r=2
 |  |  		bool loaded = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is PLA filament loaded?"), false, true);////MSG_PLA_FILAMENT_LOADED c=20 r=2
 | 
												
													
														
															|  |  		if (loaded) {
 |  |  		if (loaded) {
 | 
												
													
														
															|  | -			lcd_commands_type = LCD_COMMAND_V2_CAL;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_commands_type = LcdCommands::Layer1Cal;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		else {
 |  |  		else {
 | 
												
													
														
															|  |  			lcd_display_message_fullscreen_P(_i("Please load PLA filament first."));////MSG_PLEASE_LOAD_PLA c=20 r=4
 |  |  			lcd_display_message_fullscreen_P(_i("Please load PLA filament first."));////MSG_PLEASE_LOAD_PLA c=20 r=4
 | 
												
													
														
															|  |  			lcd_consume_click();
 |  |  			lcd_consume_click();
 | 
												
													
														
															|  | -			for (int i = 0; i < 20; i++) { //wait max. 2s
 |  | 
 | 
												
													
														
															|  | 
 |  | +			for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s
 | 
												
													
														
															|  |  				delay_keep_alive(100);
 |  |  				delay_keep_alive(100);
 | 
												
													
														
															|  |  				if (lcd_clicked()) {
 |  |  				if (lcd_clicked()) {
 | 
												
													
														
															|  |  					break;
 |  |  					break;
 | 
												
											
												
													
														
															|  | @@ -5137,7 +4963,7 @@ void lcd_wizard(WizState state)
 | 
												
													
														
															|  |  		case S::Lay1Cal:
 |  |  		case S::Lay1Cal:
 | 
												
													
														
															|  |  			lcd_show_fullscreen_message_and_wait_P(_i("Now I will calibrate distance between tip of the nozzle and heatbed surface."));////MSG_WIZARD_V2_CAL c=20 r=8
 |  |  			lcd_show_fullscreen_message_and_wait_P(_i("Now I will calibrate distance between tip of the nozzle and heatbed surface."));////MSG_WIZARD_V2_CAL c=20 r=8
 | 
												
													
														
															|  |  			lcd_show_fullscreen_message_and_wait_P(_i("I will start to print line and you will gradually lower the nozzle by rotating the knob, until you reach optimal height. Check the pictures in our handbook in chapter Calibration."));////MSG_WIZARD_V2_CAL_2 c=20 r=12
 |  |  			lcd_show_fullscreen_message_and_wait_P(_i("I will start to print line and you will gradually lower the nozzle by rotating the knob, until you reach optimal height. Check the pictures in our handbook in chapter Calibration."));////MSG_WIZARD_V2_CAL_2 c=20 r=12
 | 
												
													
														
															|  | -			lcd_commands_type = LCD_COMMAND_V2_CAL;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_commands_type = LcdCommands::Layer1Cal;
 | 
												
													
														
															|  |  			lcd_return_to_status();
 |  |  			lcd_return_to_status();
 | 
												
													
														
															|  |  			end = true;
 |  |  			end = true;
 | 
												
													
														
															|  |  			break;
 |  |  			break;
 | 
												
											
												
													
														
															|  | @@ -5294,10 +5120,16 @@ static bool settingsCutter()
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  |      if (mmu_enabled)
 |  |      if (mmu_enabled)
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | -        if (1 == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
 |  | 
 | 
												
													
														
															|  | 
 |  | +        if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
													
														
															|  |              if (menu_item_function_P(_i("Cutter       [on]"), lcd_cutter_enabled)) return true;//// c=17 r=1
 |  |              if (menu_item_function_P(_i("Cutter       [on]"), lcd_cutter_enabled)) return true;//// c=17 r=1
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | 
 |  | +#ifdef MMU_ALWAYS_CUT
 | 
												
													
														
															|  | 
 |  | +        else if (EEPROM_MMU_CUTTER_ENABLED_always == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
 | 
												
													
														
															|  | 
 |  | +        {
 | 
												
													
														
															|  | 
 |  | +            if (menu_item_function_P(_i("Cutter   [always]"), lcd_cutter_enabled)) return true;//// c=17 r=1
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  | 
 |  | +#endif
 | 
												
													
														
															|  |          else
 |  |          else
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
													
														
															|  |              if (menu_item_function_P(_i("Cutter      [off]"), lcd_cutter_enabled)) return true;//// c=17 r=1
 |  |              if (menu_item_function_P(_i("Cutter      [off]"), lcd_cutter_enabled)) return true;//// c=17 r=1
 | 
												
											
												
													
														
															|  | @@ -5461,6 +5293,101 @@ do\
 | 
												
													
														
															|  |  }\
 |  |  }\
 | 
												
													
														
															|  |  while (0)
 |  |  while (0)
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | 
 |  | +//-//
 | 
												
													
														
															|  | 
 |  | +static void lcd_check_mode_set(void)
 | 
												
													
														
															|  | 
 |  | +{
 | 
												
													
														
															|  | 
 |  | +switch(eCheckMode)
 | 
												
													
														
															|  | 
 |  | +     {
 | 
												
													
														
															|  | 
 |  | +     case e_CHECK_MODE_none:
 | 
												
													
														
															|  | 
 |  | +          eCheckMode=e_CHECK_MODE_warn;
 | 
												
													
														
															|  | 
 |  | +          break;
 | 
												
													
														
															|  | 
 |  | +     case e_CHECK_MODE_warn:
 | 
												
													
														
															|  | 
 |  | +          eCheckMode=e_CHECK_MODE_strict;
 | 
												
													
														
															|  | 
 |  | +          break;
 | 
												
													
														
															|  | 
 |  | +     case e_CHECK_MODE_strict:
 | 
												
													
														
															|  | 
 |  | +          eCheckMode=e_CHECK_MODE_none;
 | 
												
													
														
															|  | 
 |  | +          break;
 | 
												
													
														
															|  | 
 |  | +     default:
 | 
												
													
														
															|  | 
 |  | +          eCheckMode=e_CHECK_MODE_none;
 | 
												
													
														
															|  | 
 |  | +     }
 | 
												
													
														
															|  | 
 |  | +eeprom_update_byte((uint8_t*)EEPROM_CHECK_MODE,(uint8_t)eCheckMode);
 | 
												
													
														
															|  | 
 |  | +}
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +static void lcd_nozzle_diameter_set(void)
 | 
												
													
														
															|  | 
 |  | +{
 | 
												
													
														
															|  | 
 |  | +uint16_t nDiameter;
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +switch(eNozzleDiameter)
 | 
												
													
														
															|  | 
 |  | +     {
 | 
												
													
														
															|  | 
 |  | +     case e_NOZZLE_DIAMETER_250:
 | 
												
													
														
															|  | 
 |  | +          eNozzleDiameter=e_NOZZLE_DIAMETER_400;
 | 
												
													
														
															|  | 
 |  | +          nDiameter=400;
 | 
												
													
														
															|  | 
 |  | +          break;
 | 
												
													
														
															|  | 
 |  | +     case e_NOZZLE_DIAMETER_400:
 | 
												
													
														
															|  | 
 |  | +          eNozzleDiameter=e_NOZZLE_DIAMETER_600;
 | 
												
													
														
															|  | 
 |  | +          nDiameter=600;
 | 
												
													
														
															|  | 
 |  | +          break;
 | 
												
													
														
															|  | 
 |  | +     case e_NOZZLE_DIAMETER_600:
 | 
												
													
														
															|  | 
 |  | +          eNozzleDiameter=e_NOZZLE_DIAMETER_250;
 | 
												
													
														
															|  | 
 |  | +          nDiameter=250;
 | 
												
													
														
															|  | 
 |  | +          break;
 | 
												
													
														
															|  | 
 |  | +     default:
 | 
												
													
														
															|  | 
 |  | +          eNozzleDiameter=e_NOZZLE_DIAMETER_400;
 | 
												
													
														
															|  | 
 |  | +          nDiameter=400;
 | 
												
													
														
															|  | 
 |  | +     }
 | 
												
													
														
															|  | 
 |  | +eeprom_update_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER,(uint8_t)eNozzleDiameter);
 | 
												
													
														
															|  | 
 |  | +eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,nDiameter);
 | 
												
													
														
															|  | 
 |  | +}
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +#define SETTINGS_MODE \
 | 
												
													
														
															|  | 
 |  | +do\
 | 
												
													
														
															|  | 
 |  | +{\
 | 
												
													
														
															|  | 
 |  | +    switch(eCheckMode)\
 | 
												
													
														
															|  | 
 |  | +         {\
 | 
												
													
														
															|  | 
 |  | +         case e_CHECK_MODE_none:\
 | 
												
													
														
															|  | 
 |  | +              MENU_ITEM_FUNCTION_P(_i("Action     [none]"),lcd_check_mode_set);\
 | 
												
													
														
															|  | 
 |  | +              break;\
 | 
												
													
														
															|  | 
 |  | +         case e_CHECK_MODE_warn:\
 | 
												
													
														
															|  | 
 |  | +              MENU_ITEM_FUNCTION_P(_i("Action     [warn]"),lcd_check_mode_set);\
 | 
												
													
														
															|  | 
 |  | +              break;\
 | 
												
													
														
															|  | 
 |  | +         case e_CHECK_MODE_strict:\
 | 
												
													
														
															|  | 
 |  | +              MENU_ITEM_FUNCTION_P(_i("Action   [strict]"),lcd_check_mode_set);\
 | 
												
													
														
															|  | 
 |  | +              break;\
 | 
												
													
														
															|  | 
 |  | +         default:\
 | 
												
													
														
															|  | 
 |  | +              MENU_ITEM_FUNCTION_P(_i("Action     [none]"),lcd_check_mode_set);\
 | 
												
													
														
															|  | 
 |  | +         }\
 | 
												
													
														
															|  | 
 |  | +}\
 | 
												
													
														
															|  | 
 |  | +while (0)
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +#define SETTINGS_NOZZLE \
 | 
												
													
														
															|  | 
 |  | +do\
 | 
												
													
														
															|  | 
 |  | +{\
 | 
												
													
														
															|  | 
 |  | +    switch(eNozzleDiameter)\
 | 
												
													
														
															|  | 
 |  | +         {\
 | 
												
													
														
															|  | 
 |  | +         case e_NOZZLE_DIAMETER_250:\
 | 
												
													
														
															|  | 
 |  | +              MENU_ITEM_FUNCTION_P(_i("Nozzle     [0.25]"),lcd_nozzle_diameter_set);\
 | 
												
													
														
															|  | 
 |  | +              break;\
 | 
												
													
														
															|  | 
 |  | +         case e_NOZZLE_DIAMETER_400:\
 | 
												
													
														
															|  | 
 |  | +              MENU_ITEM_FUNCTION_P(_i("Nozzle     [0.40]"),lcd_nozzle_diameter_set);\
 | 
												
													
														
															|  | 
 |  | +              break;\
 | 
												
													
														
															|  | 
 |  | +         case e_NOZZLE_DIAMETER_600:\
 | 
												
													
														
															|  | 
 |  | +              MENU_ITEM_FUNCTION_P(_i("Nozzle     [0.60]"),lcd_nozzle_diameter_set);\
 | 
												
													
														
															|  | 
 |  | +              break;\
 | 
												
													
														
															|  | 
 |  | +         default:\
 | 
												
													
														
															|  | 
 |  | +              MENU_ITEM_FUNCTION_P(_i("Nozzle     [0.40]"),lcd_nozzle_diameter_set);\
 | 
												
													
														
															|  | 
 |  | +         }\
 | 
												
													
														
															|  | 
 |  | +}\
 | 
												
													
														
															|  | 
 |  | +while (0)
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +static void lcd_checking_menu()
 | 
												
													
														
															|  | 
 |  | +{
 | 
												
													
														
															|  | 
 |  | +MENU_BEGIN();
 | 
												
													
														
															|  | 
 |  | +MENU_ITEM_BACK_P(_T(MSG_SETTINGS));
 | 
												
													
														
															|  | 
 |  | +SETTINGS_MODE;
 | 
												
													
														
															|  | 
 |  | +SETTINGS_NOZZLE;
 | 
												
													
														
															|  | 
 |  | +MENU_END();
 | 
												
													
														
															|  | 
 |  | +}
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |  static void lcd_settings_menu()
 |  |  static void lcd_settings_menu()
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  |  	EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
 |  |  	EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
 | 
												
											
												
													
														
															|  | @@ -5512,6 +5439,9 @@ static void lcd_settings_menu()
 | 
												
													
														
															|  |  	MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);////MSG_LANGUAGE_SELECT
 |  |  	MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);////MSG_LANGUAGE_SELECT
 | 
												
													
														
															|  |  #endif //(LANG_MODE != 0)
 |  |  #endif //(LANG_MODE != 0)
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | 
 |  | +	if (!farm_mode)
 | 
												
													
														
															|  | 
 |  | +          MENU_ITEM_SUBMENU_P(_i("Print checking"), lcd_checking_menu);
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |  	SETTINGS_SD;
 |  |  	SETTINGS_SD;
 | 
												
													
														
															|  |  	SETTINGS_SOUND;
 |  |  	SETTINGS_SOUND;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -5603,7 +5533,7 @@ void bowden_menu() {
 | 
												
													
														
															|  |  	lcd_clear();
 |  |  	lcd_clear();
 | 
												
													
														
															|  |  	lcd_set_cursor(0, 0);
 |  |  	lcd_set_cursor(0, 0);
 | 
												
													
														
															|  |  	lcd_print(">");
 |  |  	lcd_print(">");
 | 
												
													
														
															|  | -	for (int i = 0; i < 4; i++) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +	for (uint_least8_t i = 0; i < 4; i++) {
 | 
												
													
														
															|  |  		lcd_set_cursor(1, i);
 |  |  		lcd_set_cursor(1, i);
 | 
												
													
														
															|  |  		lcd_print("Extruder ");
 |  |  		lcd_print("Extruder ");
 | 
												
													
														
															|  |  		lcd_print(i);
 |  |  		lcd_print(i);
 | 
												
											
												
													
														
															|  | @@ -5694,7 +5624,7 @@ void bowden_menu() {
 | 
												
													
														
															|  |  						enc_dif = lcd_encoder_diff;
 |  |  						enc_dif = lcd_encoder_diff;
 | 
												
													
														
															|  |  						lcd_set_cursor(0, cursor_pos);
 |  |  						lcd_set_cursor(0, cursor_pos);
 | 
												
													
														
															|  |  						lcd_print(">");
 |  |  						lcd_print(">");
 | 
												
													
														
															|  | -						for (int i = 0; i < 4; i++) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +						for (uint_least8_t i = 0; i < 4; i++) {
 | 
												
													
														
															|  |  							lcd_set_cursor(1, i);
 |  |  							lcd_set_cursor(1, i);
 | 
												
													
														
															|  |  							lcd_print("Extruder ");
 |  |  							lcd_print("Extruder ");
 | 
												
													
														
															|  |  							lcd_print(i);
 |  |  							lcd_print(i);
 | 
												
											
												
													
														
															|  | @@ -5831,14 +5761,14 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite
 | 
												
													
														
															|  |          if (header) lcd_puts_at_P(0,0,header);
 |  |          if (header) lcd_puts_at_P(0,0,header);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |          const bool last_visible = (first == items_no - 3);
 |  |          const bool last_visible = (first == items_no - 3);
 | 
												
													
														
															|  | -        const int8_t ordinary_items = (last_item&&last_visible)?2:3;
 |  | 
 | 
												
													
														
															|  | 
 |  | +        const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -        for (int i = 0; i < ordinary_items; i++)
 |  | 
 | 
												
													
														
															|  | 
 |  | +        for (uint_least8_t i = 0; i < ordinary_items; i++)
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
													
														
															|  |              if (item) lcd_puts_at_P(1, i + 1, item);
 |  |              if (item) lcd_puts_at_P(1, i + 1, item);
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -        for (int i = 0; i < ordinary_items; i++)
 |  | 
 | 
												
													
														
															|  | 
 |  | +        for (uint_least8_t i = 0; i < ordinary_items; i++)
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
													
														
															|  |              lcd_set_cursor(2 + item_len, i+1);
 |  |              lcd_set_cursor(2 + item_len, i+1);
 | 
												
													
														
															|  |              lcd_print(first + i + 1);
 |  |              lcd_print(first + i + 1);
 | 
												
											
												
													
														
															|  | @@ -5893,7 +5823,7 @@ char reset_menu() {
 | 
												
													
														
															|  |  	lcd_consume_click();
 |  |  	lcd_consume_click();
 | 
												
													
														
															|  |  	while (1) {		
 |  |  	while (1) {		
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -		for (int i = 0; i < 4; i++) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +		for (uint_least8_t i = 0; i < 4; i++) {
 | 
												
													
														
															|  |  			lcd_set_cursor(1, i);
 |  |  			lcd_set_cursor(1, i);
 | 
												
													
														
															|  |  			lcd_print(item[first + i]);
 |  |  			lcd_print(item[first + i]);
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
											
												
													
														
															|  | @@ -5982,7 +5912,7 @@ static void fil_load_menu()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |      if (mmu_enabled)
 |  |      if (mmu_enabled)
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | -        MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '5', extr_adj, 3);
 |  | 
 | 
												
													
														
															|  | 
 |  | +        MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '5', extr_adj, 4);
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |      MENU_END();
 |  |      MENU_END();
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
											
												
													
														
															|  | @@ -6002,7 +5932,7 @@ static void mmu_load_to_nozzle_menu()
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |      else
 |  |      else
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | -        eFilamentAction = e_FILAMENT_ACTION_mmuLoad;
 |  | 
 | 
												
													
														
															|  | 
 |  | +        eFilamentAction = FilamentAction::MmuLoad;
 | 
												
													
														
															|  |          bFilamentFirstRun = false;
 |  |          bFilamentFirstRun = false;
 | 
												
													
														
															|  |          if (target_temperature[0] >= EXTRUDE_MINTEMP)
 |  |          if (target_temperature[0] >= EXTRUDE_MINTEMP)
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
											
												
													
														
															|  | @@ -6034,7 +5964,7 @@ static void mmu_fil_eject_menu()
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |      else
 |  |      else
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | -        eFilamentAction = e_FILAMENT_ACTION_mmuEject;
 |  | 
 | 
												
													
														
															|  | 
 |  | +        eFilamentAction = FilamentAction::MmuEject;
 | 
												
													
														
															|  |          bFilamentFirstRun = false;
 |  |          bFilamentFirstRun = false;
 | 
												
													
														
															|  |          if (target_temperature[0] >= EXTRUDE_MINTEMP)
 |  |          if (target_temperature[0] >= EXTRUDE_MINTEMP)
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
											
												
													
														
															|  | @@ -6053,16 +5983,16 @@ static void mmu_cut_filament_menu()
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  |          MENU_BEGIN();
 |  |          MENU_BEGIN();
 | 
												
													
														
															|  |          MENU_ITEM_BACK_P(_T(MSG_MAIN));
 |  |          MENU_ITEM_BACK_P(_T(MSG_MAIN));
 | 
												
													
														
															|  | -        MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '1', mmu_cut_filament, 0);
 |  | 
 | 
												
													
														
															|  | -        MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '2', mmu_cut_filament, 1);
 |  | 
 | 
												
													
														
															|  | -        MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '3', mmu_cut_filament, 2);
 |  | 
 | 
												
													
														
															|  | -        MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '4', mmu_cut_filament, 3);
 |  | 
 | 
												
													
														
															|  | -        MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '5', mmu_cut_filament, 4);
 |  | 
 | 
												
													
														
															|  | 
 |  | +        MENU_ITEM_FUNCTION_NR_P(_T(MSG_CUT_FILAMENT), '1', mmu_cut_filament, 0);
 | 
												
													
														
															|  | 
 |  | +        MENU_ITEM_FUNCTION_NR_P(_T(MSG_CUT_FILAMENT), '2', mmu_cut_filament, 1);
 | 
												
													
														
															|  | 
 |  | +        MENU_ITEM_FUNCTION_NR_P(_T(MSG_CUT_FILAMENT), '3', mmu_cut_filament, 2);
 | 
												
													
														
															|  | 
 |  | +        MENU_ITEM_FUNCTION_NR_P(_T(MSG_CUT_FILAMENT), '4', mmu_cut_filament, 3);
 | 
												
													
														
															|  | 
 |  | +        MENU_ITEM_FUNCTION_NR_P(_T(MSG_CUT_FILAMENT), '5', mmu_cut_filament, 4);
 | 
												
													
														
															|  |          MENU_END();
 |  |          MENU_END();
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |      else
 |  |      else
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | -        eFilamentAction=e_FILAMENT_ACTION_mmuCut;
 |  | 
 | 
												
													
														
															|  | 
 |  | +        eFilamentAction=FilamentAction::MmuCut;
 | 
												
													
														
															|  |          bFilamentFirstRun=false;
 |  |          bFilamentFirstRun=false;
 | 
												
													
														
															|  |          if(target_temperature[0]>=EXTRUDE_MINTEMP)
 |  |          if(target_temperature[0]>=EXTRUDE_MINTEMP)
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
											
												
													
														
															|  | @@ -6107,7 +6037,7 @@ static void change_extr_menu(){
 | 
												
													
														
															|  |  //unload filament for single material printer (used in M702 gcode)
 |  |  //unload filament for single material printer (used in M702 gcode)
 | 
												
													
														
															|  |  void unload_filament()
 |  |  void unload_filament()
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  | -	custom_message_type = CUSTOM_MSG_TYPE_F_LOAD;
 |  | 
 | 
												
													
														
															|  | 
 |  | +	custom_message_type = CustomMsg::FilamentLoading;
 | 
												
													
														
															|  |  	lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT));
 |  |  	lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT));
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	//		extr_unload2();
 |  |  	//		extr_unload2();
 | 
												
											
												
													
														
															|  | @@ -6142,7 +6072,7 @@ void unload_filament()
 | 
												
													
														
															|  |  	lcd_update_enable(true);
 |  |  	lcd_update_enable(true);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	lcd_setstatuspgm(_T(WELCOME_MSG));
 |  |  	lcd_setstatuspgm(_T(WELCOME_MSG));
 | 
												
													
														
															|  | -	custom_message_type = CUSTOM_MSG_TYPE_STATUS;
 |  | 
 | 
												
													
														
															|  | 
 |  | +	custom_message_type = CustomMsg::Status;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -6223,7 +6153,7 @@ unsigned char lcd_choose_color() {
 | 
												
													
														
															|  |  	item[0] = "Orange";
 |  |  	item[0] = "Orange";
 | 
												
													
														
															|  |  	item[1] = "Black";
 |  |  	item[1] = "Black";
 | 
												
													
														
															|  |  	//-----------------------------------------------------
 |  |  	//-----------------------------------------------------
 | 
												
													
														
															|  | -	unsigned char active_rows;
 |  | 
 | 
												
													
														
															|  | 
 |  | +	uint_least8_t active_rows;
 | 
												
													
														
															|  |  	static int first = 0;
 |  |  	static int first = 0;
 | 
												
													
														
															|  |  	int enc_dif = 0;
 |  |  	int enc_dif = 0;
 | 
												
													
														
															|  |  	unsigned char cursor_pos = 1;
 |  |  	unsigned char cursor_pos = 1;
 | 
												
											
												
													
														
															|  | @@ -6236,7 +6166,7 @@ unsigned char lcd_choose_color() {
 | 
												
													
														
															|  |  	lcd_consume_click();
 |  |  	lcd_consume_click();
 | 
												
													
														
															|  |  	while (1) {
 |  |  	while (1) {
 | 
												
													
														
															|  |  		lcd_puts_at_P(0, 0, PSTR("Choose color:"));
 |  |  		lcd_puts_at_P(0, 0, PSTR("Choose color:"));
 | 
												
													
														
															|  | -		for (int i = 0; i < active_rows; i++) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +		for (uint_least8_t i = 0; i < active_rows; i++) {
 | 
												
													
														
															|  |  			lcd_set_cursor(1, i+1);
 |  |  			lcd_set_cursor(1, i+1);
 | 
												
													
														
															|  |  			lcd_print(item[first + i]);
 |  |  			lcd_print(item[first + i]);
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
											
												
													
														
															|  | @@ -6346,10 +6276,11 @@ void lcd_confirm_print()
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		if (lcd_clicked())
 |  |  		if (lcd_clicked())
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  | 
 |  | +               filament_type = FARM_FILAMENT_COLOR_NONE;
 | 
												
													
														
															|  |  			if (cursor_pos == 1)
 |  |  			if (cursor_pos == 1)
 | 
												
													
														
															|  |  			{
 |  |  			{
 | 
												
													
														
															|  |  				_ret = 1;
 |  |  				_ret = 1;
 | 
												
													
														
															|  | -				filament_type = lcd_choose_color();
 |  | 
 | 
												
													
														
															|  | 
 |  | +//				filament_type = lcd_choose_color();
 | 
												
													
														
															|  |  				prusa_statistics(4, filament_type);
 |  |  				prusa_statistics(4, filament_type);
 | 
												
													
														
															|  |  				no_response = true; //we need confirmation by recieving PRUSA thx
 |  |  				no_response = true; //we need confirmation by recieving PRUSA thx
 | 
												
													
														
															|  |  				important_status = 4;
 |  |  				important_status = 4;
 | 
												
											
												
													
														
															|  | @@ -6359,7 +6290,7 @@ void lcd_confirm_print()
 | 
												
													
														
															|  |  			if (cursor_pos == 2)
 |  |  			if (cursor_pos == 2)
 | 
												
													
														
															|  |  			{
 |  |  			{
 | 
												
													
														
															|  |  				_ret = 2;
 |  |  				_ret = 2;
 | 
												
													
														
															|  | -				filament_type = lcd_choose_color();
 |  | 
 | 
												
													
														
															|  | 
 |  | +//				filament_type = lcd_choose_color();
 | 
												
													
														
															|  |  				prusa_statistics(5, filament_type);
 |  |  				prusa_statistics(5, filament_type);
 | 
												
													
														
															|  |  				no_response = true; //we need confirmation by recieving PRUSA thx
 |  |  				no_response = true; //we need confirmation by recieving PRUSA thx
 | 
												
													
														
															|  |  				important_status = 5;				
 |  |  				important_status = 5;				
 | 
												
											
												
													
														
															|  | @@ -6473,13 +6404,13 @@ static void lcd_main_menu()
 | 
												
													
														
															|  |          
 |  |          
 | 
												
													
														
															|  |      }*/
 |  |      }*/
 | 
												
													
														
															|  |   
 |  |   
 | 
												
													
														
															|  | -  if ( ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag)
 |  | 
 | 
												
													
														
															|  | 
 |  | +  if ( ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag)
 | 
												
													
														
															|  |    {
 |  |    {
 | 
												
													
														
															|  |  	MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8
 |  |  	MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -  if ( moves_planned() || IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL))
 |  | 
 | 
												
													
														
															|  | 
 |  | +  if ( moves_planned() || IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal))
 | 
												
													
														
															|  |    {
 |  |    {
 | 
												
													
														
															|  |      MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE
 |  |      MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE
 | 
												
													
														
															|  |    } else 
 |  |    } else 
 | 
												
											
												
													
														
															|  | @@ -6488,7 +6419,7 @@ static void lcd_main_menu()
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  #ifdef SDSUPPORT
 |  |  #ifdef SDSUPPORT
 | 
												
													
														
															|  | -  if (card.cardOK || lcd_commands_type == LCD_COMMAND_V2_CAL)
 |  | 
 | 
												
													
														
															|  | 
 |  | +  if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal)
 | 
												
													
														
															|  |    {
 |  |    {
 | 
												
													
														
															|  |      if (card.isFileOpen())
 |  |      if (card.isFileOpen())
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
											
												
													
														
															|  | @@ -6504,12 +6435,12 @@ static void lcd_main_menu()
 | 
												
													
														
															|  |  			MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
 |  |  			MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | -	else if (lcd_commands_type == LCD_COMMAND_V2_CAL && mesh_bed_leveling_flag == false && homing_flag == false) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +	else if (lcd_commands_type == LcdCommands::Layer1Cal && mesh_bed_leveling_flag == false && homing_flag == false) {
 | 
												
													
														
															|  |  		//MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
 |  |  		//MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	else
 |  |  	else
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		if (!is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL))
 |  | 
 | 
												
													
														
															|  | 
 |  | +		if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal))
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  |  			//if (farm_mode) MENU_ITEM_SUBMENU_P(MSG_FARM_CARD_MENU, lcd_farm_sdcard_menu);
 |  |  			//if (farm_mode) MENU_ITEM_SUBMENU_P(MSG_FARM_CARD_MENU, lcd_farm_sdcard_menu);
 | 
												
													
														
															|  |  			/*else*/ {
 |  |  			/*else*/ {
 | 
												
											
												
													
														
															|  | @@ -6533,7 +6464,7 @@ static void lcd_main_menu()
 | 
												
													
														
															|  |  #endif
 |  |  #endif
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -  if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL))
 |  | 
 | 
												
													
														
															|  | 
 |  | +  if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal))
 | 
												
													
														
															|  |    {
 |  |    {
 | 
												
													
														
															|  |  	  if (farm_mode)
 |  |  	  if (farm_mode)
 | 
												
													
														
															|  |  	  {
 |  |  	  {
 | 
												
											
												
													
														
															|  | @@ -6577,7 +6508,7 @@ static void lcd_main_menu()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -  if (!is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL))
 |  | 
 | 
												
													
														
															|  | 
 |  | +  if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal))
 | 
												
													
														
															|  |    {
 |  |    {
 | 
												
													
														
															|  |  	  MENU_ITEM_SUBMENU_P(_i("Statistics  "), lcd_menu_statistics);////MSG_STATISTICS
 |  |  	  MENU_ITEM_SUBMENU_P(_i("Statistics  "), lcd_menu_statistics);////MSG_STATISTICS
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
											
												
													
														
															|  | @@ -6629,7 +6560,7 @@ static void lcd_colorprint_change() {
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  |  	enquecommand_P(PSTR("M600"));
 |  |  	enquecommand_P(PSTR("M600"));
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  | -	custom_message_type = CUSTOM_MSG_TYPE_F_LOAD; //just print status message
 |  | 
 | 
												
													
														
															|  | 
 |  | +	custom_message_type = CustomMsg::FilamentLoading; //just print status message
 | 
												
													
														
															|  |  	lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS));
 |  |  	lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS));
 | 
												
													
														
															|  |  	lcd_return_to_status();
 |  |  	lcd_return_to_status();
 | 
												
													
														
															|  |  	lcd_draw_update = 3;
 |  |  	lcd_draw_update = 3;
 | 
												
											
												
													
														
															|  | @@ -6690,6 +6621,14 @@ static void lcd_tune_menu()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	SETTINGS_CUTTER;
 |  |  	SETTINGS_CUTTER;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | 
 |  | +     if(farm_mode)
 | 
												
													
														
															|  | 
 |  | +     {
 | 
												
													
														
															|  | 
 |  | +          if (fans_check_enabled == true)
 | 
												
													
														
															|  | 
 |  | +               MENU_ITEM_FUNCTION_P(_i("Fans check   [on]"), lcd_set_fan_check);////MSG_FANS_CHECK_ON c=17 r=1
 | 
												
													
														
															|  | 
 |  | +          else
 | 
												
													
														
															|  | 
 |  | +               MENU_ITEM_FUNCTION_P(_i("Fans check  [off]"), lcd_set_fan_check);////MSG_FANS_CHECK_OFF c=17 r=1
 | 
												
													
														
															|  | 
 |  | +     }
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |  #ifdef TMC2130
 |  |  #ifdef TMC2130
 | 
												
													
														
															|  |       if(!farm_mode)
 |  |       if(!farm_mode)
 | 
												
													
														
															|  |       {
 |  |       {
 | 
												
											
												
													
														
															|  | @@ -6833,6 +6772,12 @@ static void lcd_sd_updir()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  void lcd_print_stop()
 |  |  void lcd_print_stop()
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  | 
 |  | +//-//
 | 
												
													
														
															|  | 
 |  | +     if(!card.sdprinting)
 | 
												
													
														
															|  | 
 |  | +          {
 | 
												
													
														
															|  | 
 |  | +          SERIAL_ECHOLNPGM("// action:cancel");   // for Octoprint
 | 
												
													
														
															|  | 
 |  | +          return;
 | 
												
													
														
															|  | 
 |  | +          }
 | 
												
													
														
															|  |  	saved_printing = false;
 |  |  	saved_printing = false;
 | 
												
													
														
															|  |  	cancel_heatup = true;
 |  |  	cancel_heatup = true;
 | 
												
													
														
															|  |  #ifdef MESH_BED_LEVELING
 |  |  #ifdef MESH_BED_LEVELING
 | 
												
											
												
													
														
															|  | @@ -6858,7 +6803,7 @@ void lcd_print_stop()
 | 
												
													
														
															|  |  	lcd_return_to_status();
 |  |  	lcd_return_to_status();
 | 
												
													
														
															|  |  	lcd_ignore_click(true);
 |  |  	lcd_ignore_click(true);
 | 
												
													
														
															|  |  	lcd_commands_step = 0;
 |  |  	lcd_commands_step = 0;
 | 
												
													
														
															|  | -	lcd_commands_type = LCD_COMMAND_STOP_PRINT;
 |  | 
 | 
												
													
														
															|  | 
 |  | +	lcd_commands_type = LcdCommands::StopPrint;
 | 
												
													
														
															|  |  	// Turn off the print fan
 |  |  	// Turn off the print fan
 | 
												
													
														
															|  |  	SET_OUTPUT(FAN_PIN);
 |  |  	SET_OUTPUT(FAN_PIN);
 | 
												
													
														
															|  |  	WRITE(FAN_PIN, 0);
 |  |  	WRITE(FAN_PIN, 0);
 | 
												
											
												
													
														
															|  | @@ -6972,13 +6917,13 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  	_delay(2000);
 |  |  	_delay(2000);
 | 
												
													
														
															|  |  	KEEPALIVE_STATE(IN_HANDLER);
 |  |  	KEEPALIVE_STATE(IN_HANDLER);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -	_progress = lcd_selftest_screen(testScreen::extruderFan, _progress, 3, true, 2000);
 |  | 
 | 
												
													
														
															|  | 
 |  | +	_progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000);
 | 
												
													
														
															|  |  #if (defined(FANCHECK) && defined(TACH_0))
 |  |  #if (defined(FANCHECK) && defined(TACH_0))
 | 
												
													
														
															|  |  	switch (lcd_selftest_fan_auto(0)){		// check extruder Fan
 |  |  	switch (lcd_selftest_fan_auto(0)){		// check extruder Fan
 | 
												
													
														
															|  | -		case FanCheck::extruderFan:
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case FanCheck::ExtruderFan:
 | 
												
													
														
															|  |  			_result = false;
 |  |  			_result = false;
 | 
												
													
														
															|  |  			break;
 |  |  			break;
 | 
												
													
														
															|  | -		case FanCheck::swappedFan:
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case FanCheck::SwappedFan:
 | 
												
													
														
															|  |  			_swapped_fan = true;
 |  |  			_swapped_fan = true;
 | 
												
													
														
															|  |  			// no break
 |  |  			// no break
 | 
												
													
														
															|  |  		default:
 |  |  		default:
 | 
												
											
												
													
														
															|  | @@ -6990,18 +6935,18 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  #endif //defined(TACH_0)
 |  |  #endif //defined(TACH_0)
 | 
												
													
														
															|  |  	if (!_result)
 |  |  	if (!_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		lcd_selftest_error(TestError::extruderFan, "", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +		lcd_selftest_error(TestError::ExtruderFan, "", "");
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	if (_result)
 |  |  	if (_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::printFan, _progress, 3, true, 2000);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000);
 | 
												
													
														
															|  |  #if (defined(FANCHECK) && defined(TACH_1))
 |  |  #if (defined(FANCHECK) && defined(TACH_1))
 | 
												
													
														
															|  |  	switch (lcd_selftest_fan_auto(1)){		// check print fan
 |  |  	switch (lcd_selftest_fan_auto(1)){		// check print fan
 | 
												
													
														
															|  | -		case FanCheck::printFan:
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case FanCheck::PrintFan:
 | 
												
													
														
															|  |  			_result = false;
 |  |  			_result = false;
 | 
												
													
														
															|  |  			break;
 |  |  			break;
 | 
												
													
														
															|  | -		case FanCheck::swappedFan:
 |  | 
 | 
												
													
														
															|  | 
 |  | +		case FanCheck::SwappedFan:
 | 
												
													
														
															|  |  			_swapped_fan = true;
 |  |  			_swapped_fan = true;
 | 
												
													
														
															|  |  			// no break
 |  |  			// no break
 | 
												
													
														
															|  |  		default:
 |  |  		default:
 | 
												
											
												
													
														
															|  | @@ -7013,7 +6958,7 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  #endif //defined(TACH_1)
 |  |  #endif //defined(TACH_1)
 | 
												
													
														
															|  |  		if (!_result)
 |  |  		if (!_result)
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  | -			lcd_selftest_error(TestError::printFan, "", ""); //print fan not spinning
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -7024,18 +6969,18 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  			//print fan is stil turned on; check that it is spinning
 |  |  			//print fan is stil turned on; check that it is spinning
 | 
												
													
														
															|  |  			_result = lcd_selftest_manual_fan_check(1, false, true);
 |  |  			_result = lcd_selftest_manual_fan_check(1, false, true);
 | 
												
													
														
															|  |  			if (!_result){
 |  |  			if (!_result){
 | 
												
													
														
															|  | -				lcd_selftest_error(TestError::printFan, "", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +				lcd_selftest_error(TestError::PrintFan, "", "");
 | 
												
													
														
															|  |  			}
 |  |  			}
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		else {
 |  |  		else {
 | 
												
													
														
															|  |  			// fans are swapped
 |  |  			// fans are swapped
 | 
												
													
														
															|  | -			lcd_selftest_error(TestError::swappedFan, "", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_selftest_error(TestError::SwappedFan, "", "");
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	if (_result)
 |  |  	if (_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::fansOk, _progress, 3, true, 2000);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000);
 | 
												
													
														
															|  |  #ifndef TMC2130
 |  |  #ifndef TMC2130
 | 
												
													
														
															|  |  		_result = lcd_selfcheck_endstops();
 |  |  		_result = lcd_selfcheck_endstops();
 | 
												
													
														
															|  |  #else
 |  |  #else
 | 
												
											
												
													
														
															|  | @@ -7046,7 +6991,7 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  	if (_result)
 |  |  	if (_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		//current_position[Z_AXIS] += 15;									//move Z axis higher to avoid false triggering of Z end stop in case that we are very low - just above heatbed
 |  |  		//current_position[Z_AXIS] += 15;									//move Z axis higher to avoid false triggering of Z end stop in case that we are very low - just above heatbed
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::axisX, _progress, 3, true, 2000);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 2000);
 | 
												
													
														
															|  |  #ifdef TMC2130
 |  |  #ifdef TMC2130
 | 
												
													
														
															|  |          _result = lcd_selfcheck_axis_sg(X_AXIS);
 |  |          _result = lcd_selfcheck_axis_sg(X_AXIS);
 | 
												
													
														
															|  |  #else
 |  |  #else
 | 
												
											
												
													
														
															|  | @@ -7059,7 +7004,7 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	if (_result)
 |  |  	if (_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::axisX, _progress, 3, true, 0);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  #ifndef TMC2130
 |  |  #ifndef TMC2130
 | 
												
													
														
															|  |  		_result = lcd_selfcheck_pulleys(X_AXIS);
 |  |  		_result = lcd_selfcheck_pulleys(X_AXIS);
 | 
												
											
												
													
														
															|  | @@ -7069,7 +7014,7 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	if (_result)
 |  |  	if (_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::axisY, _progress, 3, true, 1500);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500);
 | 
												
													
														
															|  |  #ifdef TMC2130
 |  |  #ifdef TMC2130
 | 
												
													
														
															|  |  		_result = lcd_selfcheck_axis_sg(Y_AXIS);
 |  |  		_result = lcd_selfcheck_axis_sg(Y_AXIS);
 | 
												
													
														
															|  |  #else
 |  |  #else
 | 
												
											
												
													
														
															|  | @@ -7079,7 +7024,7 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	if (_result)
 |  |  	if (_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::axisZ, _progress, 3, true, 0);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0);
 | 
												
													
														
															|  |  #ifndef TMC2130
 |  |  #ifndef TMC2130
 | 
												
													
														
															|  |  		_result = lcd_selfcheck_pulleys(Y_AXIS);
 |  |  		_result = lcd_selfcheck_pulleys(Y_AXIS);
 | 
												
													
														
															|  |  #endif // TMC2130
 |  |  #endif // TMC2130
 | 
												
											
												
													
														
															|  | @@ -7100,7 +7045,7 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  		current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
 |  |  		current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
 | 
												
													
														
															|  |  		plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
 |  |  		plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
 | 
												
													
														
															|  |  		st_synchronize();
 |  |  		st_synchronize();
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::axisZ, _progress, 3, true, 1500);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500);
 | 
												
													
														
															|  |  		_result = lcd_selfcheck_axis(2, Z_MAX_POS);
 |  |  		_result = lcd_selfcheck_axis(2, Z_MAX_POS);
 | 
												
													
														
															|  |  		if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) != 1) {
 |  |  		if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) != 1) {
 | 
												
													
														
															|  |  			enquecommand_P(PSTR("G28 W"));
 |  |  			enquecommand_P(PSTR("G28 W"));
 | 
												
											
												
													
														
															|  | @@ -7114,11 +7059,11 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  		current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
 |  |  		current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
 | 
												
													
														
															|  |  		plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
 |  |  		plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
 | 
												
													
														
															|  |  		st_synchronize();
 |  |  		st_synchronize();
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::home, 0, 2, true, 0);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0);
 | 
												
													
														
															|  |  		bool bres = tmc2130_home_calibrate(X_AXIS);
 |  |  		bool bres = tmc2130_home_calibrate(X_AXIS);
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::home, 1, 2, true, 0);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0);
 | 
												
													
														
															|  |  		bres &= tmc2130_home_calibrate(Y_AXIS);
 |  |  		bres &= tmc2130_home_calibrate(Y_AXIS);
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::home, 2, 2, true, 0);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0);
 | 
												
													
														
															|  |  		if (bres)
 |  |  		if (bres)
 | 
												
													
														
															|  |  			eeprom_update_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1);
 |  |  			eeprom_update_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1);
 | 
												
													
														
															|  |  		_result = bres;
 |  |  		_result = bres;
 | 
												
											
												
													
														
															|  | @@ -7127,18 +7072,18 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	if (_result)
 |  |  	if (_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::bed, _progress, 3, true, 2000);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000);
 | 
												
													
														
															|  |  		_result = lcd_selfcheck_check_heater(true);
 |  |  		_result = lcd_selfcheck_check_heater(true);
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |      if (_result)
 |  |      if (_result)
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | -        _progress = lcd_selftest_screen(testScreen::hotend, _progress, 3, true, 1000);
 |  | 
 | 
												
													
														
															|  | 
 |  | +        _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000);
 | 
												
													
														
															|  |          _result = lcd_selfcheck_check_heater(false);
 |  |          _result = lcd_selfcheck_check_heater(false);
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |  	if (_result)
 |  |  	if (_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::hotendOk, _progress, 3, true, 2000); //nozzle ok
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  #ifdef FILAMENT_SENSOR
 |  |  #ifdef FILAMENT_SENSOR
 | 
												
													
														
															|  |      if (_result)
 |  |      if (_result)
 | 
												
											
												
													
														
															|  | @@ -7146,20 +7091,20 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |          if (mmu_enabled)
 |  |          if (mmu_enabled)
 | 
												
													
														
															|  |          {        
 |  |          {        
 | 
												
													
														
															|  | -			_progress = lcd_selftest_screen(testScreen::fsensor, _progress, 3, true, 2000); //check filaments sensor
 |  | 
 | 
												
													
														
															|  | 
 |  | +			_progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor
 | 
												
													
														
															|  |              _result = selftest_irsensor();
 |  |              _result = selftest_irsensor();
 | 
												
													
														
															|  |  		    if (_result)
 |  |  		    if (_result)
 | 
												
													
														
															|  |  			{
 |  |  			{
 | 
												
													
														
															|  | -				_progress = lcd_selftest_screen(testScreen::fsensorOk, _progress, 3, true, 2000); //fil sensor OK
 |  | 
 | 
												
													
														
															|  | 
 |  | +				_progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK
 | 
												
													
														
															|  |  			}
 |  |  			}
 | 
												
													
														
															|  |          } else
 |  |          } else
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
													
														
															|  |  #ifdef PAT9125
 |  |  #ifdef PAT9125
 | 
												
													
														
															|  | -			_progress = lcd_selftest_screen(testScreen::fsensor, _progress, 3, true, 2000); //check filaments sensor
 |  | 
 | 
												
													
														
															|  | 
 |  | +			_progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor
 | 
												
													
														
															|  |              _result = lcd_selftest_fsensor();
 |  |              _result = lcd_selftest_fsensor();
 | 
												
													
														
															|  |  			if (_result)
 |  |  			if (_result)
 | 
												
													
														
															|  |  			{
 |  |  			{
 | 
												
													
														
															|  | -				_progress = lcd_selftest_screen(testScreen::fsensorOk, _progress, 3, true, 2000); //fil sensor OK
 |  | 
 | 
												
													
														
															|  | 
 |  | +				_progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK
 | 
												
													
														
															|  |  			}
 |  |  			}
 | 
												
													
														
															|  |  #endif //PAT9125
 |  |  #endif //PAT9125
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
											
												
													
														
															|  | @@ -7167,11 +7112,11 @@ bool lcd_selftest()
 | 
												
													
														
															|  |  #endif //FILAMENT_SENSOR
 |  |  #endif //FILAMENT_SENSOR
 | 
												
													
														
															|  |  	if (_result)
 |  |  	if (_result)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::allCorrect, _progress, 3, true, 5000); //all correct
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	else
 |  |  	else
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		_progress = lcd_selftest_screen(testScreen::failed, _progress, 3, true, 5000);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000);
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	lcd_reset_alert_level();
 |  |  	lcd_reset_alert_level();
 | 
												
													
														
															|  |  	enquecommand_P(PSTR("M84"));
 |  |  	enquecommand_P(PSTR("M84"));
 | 
												
											
												
													
														
															|  | @@ -7274,7 +7219,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  //end of second measurement, now check for possible errors:
 |  |  //end of second measurement, now check for possible errors:
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -	for(int i = 0; i < 2; i++){ //check if measured axis length corresponds to expected length
 |  | 
 | 
												
													
														
															|  | 
 |  | +	for(uint_least8_t i = 0; i < 2; i++){ //check if measured axis length corresponds to expected length
 | 
												
													
														
															|  |  		printf_P(_N("Measured axis length:%.3f\n"), measured_axis_length[i]);
 |  |  		printf_P(_N("Measured axis length:%.3f\n"), measured_axis_length[i]);
 | 
												
													
														
															|  |  		if (abs(measured_axis_length[i] - axis_length) > max_error_mm) {
 |  |  		if (abs(measured_axis_length[i] - axis_length) > max_error_mm) {
 | 
												
													
														
															|  |  			enable_endstops(false);
 |  |  			enable_endstops(false);
 | 
												
											
												
													
														
															|  | @@ -7285,7 +7230,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
 | 
												
													
														
															|  |  			if (axis == Y_AXIS) _error_1 = "Y";
 |  |  			if (axis == Y_AXIS) _error_1 = "Y";
 | 
												
													
														
															|  |  			if (axis == Z_AXIS) _error_1 = "Z";
 |  |  			if (axis == Z_AXIS) _error_1 = "Z";
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -			lcd_selftest_error(TestError::axis, _error_1, "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_selftest_error(TestError::Axis, _error_1, "");
 | 
												
													
														
															|  |  			current_position[axis] = 0;
 |  |  			current_position[axis] = 0;
 | 
												
													
														
															|  |  			plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
 |  |  			plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
 | 
												
													
														
															|  |  			reset_crash_det(axis);
 |  |  			reset_crash_det(axis);
 | 
												
											
												
													
														
															|  | @@ -7303,7 +7248,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
 | 
												
													
														
															|  |  			if (axis == Y_AXIS) _error_1 = "Y";
 |  |  			if (axis == Y_AXIS) _error_1 = "Y";
 | 
												
													
														
															|  |  			if (axis == Z_AXIS) _error_1 = "Z";
 |  |  			if (axis == Z_AXIS) _error_1 = "Z";
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -			lcd_selftest_error(TestError::pulley, _error_1, "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_selftest_error(TestError::Pulley, _error_1, "");
 | 
												
													
														
															|  |  			current_position[axis] = 0;
 |  |  			current_position[axis] = 0;
 | 
												
													
														
															|  |  			plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
 |  |  			plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
 | 
												
													
														
															|  |  			reset_crash_det(axis);
 |  |  			reset_crash_det(axis);
 | 
												
											
												
													
														
															|  | @@ -7378,7 +7323,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		else
 |  |  		else
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  | -			_progress = lcd_selftest_screen(static_cast<testScreen>(static_cast<int>(testScreen::axisX) + _axis), _progress, 3, false, 0);
 |  | 
 | 
												
													
														
															|  | 
 |  | +			_progress = lcd_selftest_screen(static_cast<TestScreen>(static_cast<int>(TestScreen::AxisX) + _axis), _progress, 3, false, 0);
 | 
												
													
														
															|  |  			_lcd_refresh = 0;
 |  |  			_lcd_refresh = 0;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -7410,11 +7355,11 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  		if (_travel_done >= _travel)
 |  |  		if (_travel_done >= _travel)
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  | -			lcd_selftest_error(TestError::endstop, _error_1, _error_2);
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_selftest_error(TestError::Endstop, _error_1, _error_2);
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		else
 |  |  		else
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  | -			lcd_selftest_error(TestError::motor, _error_1, _error_2);
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_selftest_error(TestError::Motor, _error_1, _error_2);
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -7454,7 +7399,7 @@ static bool lcd_selfcheck_pulleys(int axis)
 | 
												
													
														
															|  |  		st_synchronize();
 |  |  		st_synchronize();
 | 
												
													
														
															|  |  		if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
 |  |  		if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
 | 
												
													
														
															|  |  			((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
 |  |  			((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
 | 
												
													
														
															|  | -			lcd_selftest_error(TestError::pulley, (axis == 0) ? "X" : "Y", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
 | 
												
													
														
															|  |  			return(false);
 |  |  			return(false);
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
											
												
													
														
															|  | @@ -7472,7 +7417,7 @@ static bool lcd_selfcheck_pulleys(int axis)
 | 
												
													
														
															|  |  				return(true);
 |  |  				return(true);
 | 
												
													
														
															|  |  			}
 |  |  			}
 | 
												
													
														
															|  |  			else {
 |  |  			else {
 | 
												
													
														
															|  | -				lcd_selftest_error(TestError::pulley, (axis == 0) ? "X" : "Y", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +				lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
 | 
												
													
														
															|  |  				return(false);
 |  |  				return(false);
 | 
												
													
														
															|  |  			}
 |  |  			}
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
											
												
													
														
															|  | @@ -7481,7 +7426,7 @@ static bool lcd_selfcheck_pulleys(int axis)
 | 
												
													
														
															|  |  			plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
 |  |  			plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
 | 
												
													
														
															|  |  			st_synchronize();
 |  |  			st_synchronize();
 | 
												
													
														
															|  |  			if (_millis() > timeout_counter) {
 |  |  			if (_millis() > timeout_counter) {
 | 
												
													
														
															|  | -				lcd_selftest_error(TestError::pulley, (axis == 0) ? "X" : "Y", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +				lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
 | 
												
													
														
															|  |  				return(false);
 |  |  				return(false);
 | 
												
													
														
															|  |  			}
 |  |  			}
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
											
												
													
														
															|  | @@ -7514,7 +7459,7 @@ static bool lcd_selfcheck_endstops()
 | 
												
													
														
															|  |  		if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X");
 |  |  		if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X");
 | 
												
													
														
															|  |  		if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y");
 |  |  		if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y");
 | 
												
													
														
															|  |  		if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z");
 |  |  		if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z");
 | 
												
													
														
															|  | -		lcd_selftest_error(TestError::endstops, _error, "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +		lcd_selftest_error(TestError::Endstops, _error, "");
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	manage_heater();
 |  |  	manage_heater();
 | 
												
													
														
															|  |  	manage_inactivity(true);
 |  |  	manage_inactivity(true);
 | 
												
											
												
													
														
															|  | @@ -7545,7 +7490,7 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  		manage_heater();
 |  |  		manage_heater();
 | 
												
													
														
															|  |  		manage_inactivity(true);
 |  |  		manage_inactivity(true);
 | 
												
													
														
															|  | -		_progress = (_isbed) ? lcd_selftest_screen(testScreen::bed, _progress, 2, false, 400) : lcd_selftest_screen(testScreen::hotend, _progress, 2, false, 400);
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_progress = (_isbed) ? lcd_selftest_screen(TestScreen::Bed, _progress, 2, false, 400) : lcd_selftest_screen(TestScreen::Hotend, _progress, 2, false, 400);
 | 
												
													
														
															|  |  		/*if (_isbed) {
 |  |  		/*if (_isbed) {
 | 
												
													
														
															|  |  			MYSERIAL.print("Bed temp:");
 |  |  			MYSERIAL.print("Bed temp:");
 | 
												
													
														
															|  |  			MYSERIAL.println(degBed());
 |  |  			MYSERIAL.println(degBed());
 | 
												
											
												
													
														
															|  | @@ -7580,12 +7525,12 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		else
 |  |  		else
 | 
												
													
														
															|  |  		{
 |  |  		{
 | 
												
													
														
															|  | -			lcd_selftest_error(TestError::heater, "", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +			lcd_selftest_error(TestError::Heater, "", "");
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	else
 |  |  	else
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		lcd_selftest_error(TestError::bed, "", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +		lcd_selftest_error(TestError::Bed, "", "");
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	manage_heater();
 |  |  	manage_heater();
 | 
												
											
												
													
														
															|  | @@ -7612,19 +7557,19 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	switch (testError)
 |  |  	switch (testError)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -	case TestError::heater:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::Heater:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_i("Heater/Thermistor"));////MSG_SELFTEST_HEATERTHERMISTOR
 |  |  		lcd_puts_P(_i("Heater/Thermistor"));////MSG_SELFTEST_HEATERTHERMISTOR
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
													
														
															|  |  		lcd_puts_P(_i("Not connected"));////MSG_SELFTEST_NOTCONNECTED
 |  |  		lcd_puts_P(_i("Not connected"));////MSG_SELFTEST_NOTCONNECTED
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::bed:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::Bed:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_i("Bed / Heater"));////MSG_SELFTEST_BEDHEATER
 |  |  		lcd_puts_P(_i("Bed / Heater"));////MSG_SELFTEST_BEDHEATER
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
													
														
															|  |  		lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
 |  |  		lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::endstops:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::Endstops:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_i("Endstops"));////MSG_SELFTEST_ENDSTOPS
 |  |  		lcd_puts_P(_i("Endstops"));////MSG_SELFTEST_ENDSTOPS
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -7632,7 +7577,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
 | 
												
													
														
															|  |  		lcd_set_cursor(17, 3);
 |  |  		lcd_set_cursor(17, 3);
 | 
												
													
														
															|  |  		lcd_print(_error_1);
 |  |  		lcd_print(_error_1);
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::motor:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::Motor:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_T(MSG_SELFTEST_MOTOR));
 |  |  		lcd_puts_P(_T(MSG_SELFTEST_MOTOR));
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 2);
 |  |  		lcd_set_cursor(18, 2);
 | 
												
											
												
													
														
															|  | @@ -7642,7 +7587,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 3);
 |  |  		lcd_set_cursor(18, 3);
 | 
												
													
														
															|  |  		lcd_print(_error_2);
 |  |  		lcd_print(_error_2);
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::endstop:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::Endstop:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_i("Endstop not hit"));////MSG_SELFTEST_ENDSTOP_NOTHIT c=20 r=1
 |  |  		lcd_puts_P(_i("Endstop not hit"));////MSG_SELFTEST_ENDSTOP_NOTHIT c=20 r=1
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -7650,7 +7595,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 3);
 |  |  		lcd_set_cursor(18, 3);
 | 
												
													
														
															|  |  		lcd_print(_error_1);
 |  |  		lcd_print(_error_1);
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::printFan:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::PrintFan:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_T(MSG_SELFTEST_COOLING_FAN));
 |  |  		lcd_puts_P(_T(MSG_SELFTEST_COOLING_FAN));
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -7658,7 +7603,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 3);
 |  |  		lcd_set_cursor(18, 3);
 | 
												
													
														
															|  |  		lcd_print(_error_1);
 |  |  		lcd_print(_error_1);
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::extruderFan:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::ExtruderFan:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_T(MSG_SELFTEST_EXTRUDER_FAN));
 |  |  		lcd_puts_P(_T(MSG_SELFTEST_EXTRUDER_FAN));
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -7666,7 +7611,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 3);
 |  |  		lcd_set_cursor(18, 3);
 | 
												
													
														
															|  |  		lcd_print(_error_1);
 |  |  		lcd_print(_error_1);
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::pulley:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::Pulley:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_i("Loose pulley"));////MSG_LOOSE_PULLEY c=20 r=1
 |  |  		lcd_puts_P(_i("Loose pulley"));////MSG_LOOSE_PULLEY c=20 r=1
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -7674,7 +7619,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 3);
 |  |  		lcd_set_cursor(18, 3);
 | 
												
													
														
															|  |  		lcd_print(_error_1);
 |  |  		lcd_print(_error_1);
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::axis:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::Axis:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_i("Axis length"));////MSG_SELFTEST_AXIS_LENGTH
 |  |  		lcd_puts_P(_i("Axis length"));////MSG_SELFTEST_AXIS_LENGTH
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -7682,7 +7627,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 3);
 |  |  		lcd_set_cursor(18, 3);
 | 
												
													
														
															|  |  		lcd_print(_error_1);
 |  |  		lcd_print(_error_1);
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::swappedFan:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::SwappedFan:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_i("Front/left fans"));////MSG_SELFTEST_FANS
 |  |  		lcd_puts_P(_i("Front/left fans"));////MSG_SELFTEST_FANS
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -7690,13 +7635,13 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 3);
 |  |  		lcd_set_cursor(18, 3);
 | 
												
													
														
															|  |  		lcd_print(_error_1);
 |  |  		lcd_print(_error_1);
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::wiringFsensor:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::WiringFsensor:
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 2);
 |  |  		lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |  		lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
 |  |  		lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
 | 
												
													
														
															|  |  		lcd_set_cursor(0, 3);
 |  |  		lcd_set_cursor(0, 3);
 | 
												
													
														
															|  |  		lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
 |  |  		lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  | -	case TestError::triggeringFsensor:
 |  | 
 | 
												
													
														
															|  | 
 |  | +	case TestError::TriggeringFsensor:
 | 
												
													
														
															|  |  	    lcd_set_cursor(0, 2);
 |  |  	    lcd_set_cursor(0, 2);
 | 
												
													
														
															|  |          lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
 |  |          lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
 | 
												
													
														
															|  |          lcd_set_cursor(0, 3);
 |  |          lcd_set_cursor(0, 3);
 | 
												
											
												
													
														
															|  | @@ -7725,7 +7670,7 @@ static bool lcd_selftest_fsensor(void)
 | 
												
													
														
															|  |  	fsensor_init();
 |  |  	fsensor_init();
 | 
												
													
														
															|  |  	if (fsensor_not_responding)
 |  |  	if (fsensor_not_responding)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  | -		lcd_selftest_error(TestError::wiringFsensor, "", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +		lcd_selftest_error(TestError::WiringFsensor, "", "");
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	return (!fsensor_not_responding);
 |  |  	return (!fsensor_not_responding);
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
											
												
													
														
															|  | @@ -7763,23 +7708,23 @@ static bool selftest_irsensor()
 | 
												
													
														
															|  |          TempBackup tempBackup;
 |  |          TempBackup tempBackup;
 | 
												
													
														
															|  |          setTargetHotend(ABS_PREHEAT_HOTEND_TEMP,active_extruder);
 |  |          setTargetHotend(ABS_PREHEAT_HOTEND_TEMP,active_extruder);
 | 
												
													
														
															|  |          mmu_wait_for_heater_blocking();
 |  |          mmu_wait_for_heater_blocking();
 | 
												
													
														
															|  | -        progress = lcd_selftest_screen(testScreen::fsensor, 0, 1, true, 0);
 |  | 
 | 
												
													
														
															|  | 
 |  | +        progress = lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0);
 | 
												
													
														
															|  |          mmu_filament_ramming();
 |  |          mmu_filament_ramming();
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  | -    progress = lcd_selftest_screen(testScreen::fsensor, progress, 1, true, 0);
 |  | 
 | 
												
													
														
															|  | 
 |  | +    progress = lcd_selftest_screen(TestScreen::Fsensor, progress, 1, true, 0);
 | 
												
													
														
															|  |      mmu_command(MmuCmd::U0);
 |  |      mmu_command(MmuCmd::U0);
 | 
												
													
														
															|  |      manage_response(false, false);
 |  |      manage_response(false, false);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |      for(uint_least8_t i = 0; i < 200; ++i)
 |  |      for(uint_least8_t i = 0; i < 200; ++i)
 | 
												
													
														
															|  |      {
 |  |      {
 | 
												
													
														
															|  | -        if (0 == (i % 32)) progress = lcd_selftest_screen(testScreen::fsensor, progress, 1, true, 0);
 |  | 
 | 
												
													
														
															|  | 
 |  | +        if (0 == (i % 32)) progress = lcd_selftest_screen(TestScreen::Fsensor, progress, 1, true, 0);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |          mmu_load_step(false);
 |  |          mmu_load_step(false);
 | 
												
													
														
															|  |          while (blocks_queued())
 |  |          while (blocks_queued())
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
													
														
															|  |              if (PIN_GET(IR_SENSOR_PIN) == 0)
 |  |              if (PIN_GET(IR_SENSOR_PIN) == 0)
 | 
												
													
														
															|  |              {
 |  |              {
 | 
												
													
														
															|  | -                lcd_selftest_error(TestError::triggeringFsensor, "", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | +                lcd_selftest_error(TestError::TriggeringFsensor, "", "");
 | 
												
													
														
															|  |                  return false;
 |  |                  return false;
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  |  #ifdef TMC2130
 |  |  #ifdef TMC2130
 | 
												
											
												
													
														
															|  | @@ -7924,11 +7869,11 @@ static FanCheck lcd_selftest_fan_auto(int _fan)
 | 
												
													
														
															|  |  		printf_P(PSTR("Extr fan speed: %d \n"), fan_speed[0]);
 |  |  		printf_P(PSTR("Extr fan speed: %d \n"), fan_speed[0]);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  		if (!fan_speed[0]) {
 |  |  		if (!fan_speed[0]) {
 | 
												
													
														
															|  | -			return FanCheck::extruderFan;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			return FanCheck::ExtruderFan;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  #ifdef FAN_SOFT_PWM
 |  |  #ifdef FAN_SOFT_PWM
 | 
												
													
														
															|  |  		else if (fan_speed[0] > 50 ) { // printerFan is faster
 |  |  		else if (fan_speed[0] > 50 ) { // printerFan is faster
 | 
												
													
														
															|  | -			return FanCheck::swappedFan;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			return FanCheck::SwappedFan;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  |  #endif
 |  |  #endif
 | 
												
											
												
													
														
															|  | @@ -7963,7 +7908,7 @@ static FanCheck lcd_selftest_fan_auto(int _fan)
 | 
												
													
														
															|  |  		printf_P(PSTR("Print fan speed: %d \n"), fan_speed[1]);
 |  |  		printf_P(PSTR("Print fan speed: %d \n"), fan_speed[1]);
 | 
												
													
														
															|  |  		printf_P(PSTR("Extr fan speed: %d \n"), fan_speed[0]);
 |  |  		printf_P(PSTR("Extr fan speed: %d \n"), fan_speed[0]);
 | 
												
													
														
															|  |  		if (!fan_speed[1]) {
 |  |  		if (!fan_speed[1]) {
 | 
												
													
														
															|  | -			return FanCheck::printFan;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			return FanCheck::PrintFan;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  #ifdef FAN_SOFT_PWM
 |  |  #ifdef FAN_SOFT_PWM
 | 
												
											
												
													
														
															|  | @@ -7982,23 +7927,23 @@ static FanCheck lcd_selftest_fan_auto(int _fan)
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  		// noctua speed is between 17 and 24, turbine more then 30
 |  |  		// noctua speed is between 17 and 24, turbine more then 30
 | 
												
													
														
															|  |  		if (fan_speed[1] < 30) {
 |  |  		if (fan_speed[1] < 30) {
 | 
												
													
														
															|  | -			return FanCheck::swappedFan;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			return FanCheck::SwappedFan;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  #else
 |  |  #else
 | 
												
													
														
															|  |  		// fan is spinning, but measured RPM are too low for print fan, it must
 |  |  		// fan is spinning, but measured RPM are too low for print fan, it must
 | 
												
													
														
															|  |  		// be left extruder fan
 |  |  		// be left extruder fan
 | 
												
													
														
															|  |  		else if (fan_speed[1] < 34) {
 |  |  		else if (fan_speed[1] < 34) {
 | 
												
													
														
															|  | -			return FanCheck::swappedFan;
 |  | 
 | 
												
													
														
															|  | 
 |  | +			return FanCheck::SwappedFan;
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  #endif //FAN_SOFT_PWM
 |  |  #endif //FAN_SOFT_PWM
 | 
												
													
														
															|  |  		break;
 |  |  		break;
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | -	return FanCheck::success;
 |  | 
 | 
												
													
														
															|  | 
 |  | +	return FanCheck::Success;
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  #endif //FANCHECK
 |  |  #endif //FANCHECK
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -static int lcd_selftest_screen(testScreen screen, int _progress, int _progress_scale, bool _clear, int _delay)
 |  | 
 | 
												
													
														
															|  | 
 |  | +static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_scale, bool _clear, int _delay)
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |      lcd_update_enable(false);
 |  |      lcd_update_enable(false);
 | 
												
											
												
													
														
															|  | @@ -8010,58 +7955,58 @@ static int lcd_selftest_screen(testScreen screen, int _progress, int _progress_s
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	lcd_set_cursor(0, 0);
 |  |  	lcd_set_cursor(0, 0);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -	if (screen == testScreen::extruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN));
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::printFan) lcd_puts_P(_T(MSG_SELFTEST_FAN));
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::fansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN));
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::endStops) lcd_puts_P(_i("Checking endstops"));////MSG_SELFTEST_CHECK_ENDSTOPS c=20
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::axisX) lcd_puts_P(_i("Checking X axis  "));////MSG_SELFTEST_CHECK_X c=20
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::axisY) lcd_puts_P(_i("Checking Y axis  "));////MSG_SELFTEST_CHECK_Y c=20
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::axisZ) lcd_puts_P(_i("Checking Z axis  "));////MSG_SELFTEST_CHECK_Z c=20
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED));
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::hotend
 |  | 
 | 
												
													
														
															|  | -	    || screen == testScreen::hotendOk) lcd_puts_P(_i("Checking hotend  "));////MSG_SELFTEST_CHECK_HOTEND c=20
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::fsensor) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR));
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::fsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR));
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::allCorrect) lcd_puts_P(_i("All correct      "));////MSG_SELFTEST_CHECK_ALLCORRECT c=20
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED));
 |  | 
 | 
												
													
														
															|  | -	if (screen == testScreen::home) lcd_puts_P(_i("Calibrating home"));////c=20 r=1
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN));
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN));
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN));
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::EndStops) lcd_puts_P(_i("Checking endstops"));////MSG_SELFTEST_CHECK_ENDSTOPS c=20
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::AxisX) lcd_puts_P(_i("Checking X axis  "));////MSG_SELFTEST_CHECK_X c=20
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::AxisY) lcd_puts_P(_i("Checking Y axis  "));////MSG_SELFTEST_CHECK_Y c=20
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::AxisZ) lcd_puts_P(_i("Checking Z axis  "));////MSG_SELFTEST_CHECK_Z c=20
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED));
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::Hotend
 | 
												
													
														
															|  | 
 |  | +	    || screen == TestScreen::HotendOk) lcd_puts_P(_i("Checking hotend  "));////MSG_SELFTEST_CHECK_HOTEND c=20
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::Fsensor) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR));
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR));
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::AllCorrect) lcd_puts_P(_i("All correct      "));////MSG_SELFTEST_CHECK_ALLCORRECT c=20
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED));
 | 
												
													
														
															|  | 
 |  | +	if (screen == TestScreen::Home) lcd_puts_P(_i("Calibrating home"));////c=20 r=1
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	lcd_set_cursor(0, 1);
 |  |  	lcd_set_cursor(0, 1);
 | 
												
													
														
															|  |  	lcd_puts_P(separator);
 |  |  	lcd_puts_P(separator);
 | 
												
													
														
															|  | -	if ((screen >= testScreen::extruderFan) && (screen <= testScreen::fansOk))
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk))
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		//SERIAL_ECHOLNPGM("Fan test");
 |  |  		//SERIAL_ECHOLNPGM("Fan test");
 | 
												
													
														
															|  |  		lcd_puts_at_P(0, 2, _i("Extruder fan:"));////MSG_SELFTEST_EXTRUDER_FAN_SPEED c=18
 |  |  		lcd_puts_at_P(0, 2, _i("Extruder fan:"));////MSG_SELFTEST_EXTRUDER_FAN_SPEED c=18
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 2);
 |  |  		lcd_set_cursor(18, 2);
 | 
												
													
														
															|  | -		(screen < testScreen::printFan) ? lcd_print(_indicator) : lcd_print("OK");
 |  | 
 | 
												
													
														
															|  | 
 |  | +		(screen < TestScreen::PrintFan) ? lcd_print(_indicator) : lcd_print("OK");
 | 
												
													
														
															|  |  		lcd_puts_at_P(0, 3, _i("Print fan:"));////MSG_SELFTEST_PRINT_FAN_SPEED c=18
 |  |  		lcd_puts_at_P(0, 3, _i("Print fan:"));////MSG_SELFTEST_PRINT_FAN_SPEED c=18
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 3);
 |  |  		lcd_set_cursor(18, 3);
 | 
												
													
														
															|  | -		(screen < testScreen::fansOk) ? lcd_print(_indicator) : lcd_print("OK");
 |  | 
 | 
												
													
														
															|  | 
 |  | +		(screen < TestScreen::FansOk) ? lcd_print(_indicator) : lcd_print("OK");
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | -	else if (screen >= testScreen::fsensor && screen <= testScreen::fsensorOk)
 |  | 
 | 
												
													
														
															|  | 
 |  | +	else if (screen >= TestScreen::Fsensor && screen <= TestScreen::FsensorOk)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR));
 |  |  		lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR));
 | 
												
													
														
															|  |  		lcd_putc(':');
 |  |  		lcd_putc(':');
 | 
												
													
														
															|  |  		lcd_set_cursor(18, 2);
 |  |  		lcd_set_cursor(18, 2);
 | 
												
													
														
															|  | -		(screen == testScreen::fsensor) ? lcd_print(_indicator) : lcd_print("OK");
 |  | 
 | 
												
													
														
															|  | 
 |  | +		(screen == TestScreen::Fsensor) ? lcd_print(_indicator) : lcd_print("OK");
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | -	else if (screen < testScreen::fsensor)
 |  | 
 | 
												
													
														
															|  | 
 |  | +	else if (screen < TestScreen::Fsensor)
 | 
												
													
														
															|  |  	{
 |  |  	{
 | 
												
													
														
															|  |  		//SERIAL_ECHOLNPGM("Other tests");
 |  |  		//SERIAL_ECHOLNPGM("Other tests");
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -	    testScreen _step_block = testScreen::axisX;
 |  | 
 | 
												
													
														
															|  | 
 |  | +	    TestScreen _step_block = TestScreen::AxisX;
 | 
												
													
														
															|  |  		lcd_selftest_screen_step(2, 2, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "X", _indicator);
 |  |  		lcd_selftest_screen_step(2, 2, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "X", _indicator);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -		_step_block = testScreen::axisY;
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_step_block = TestScreen::AxisY;
 | 
												
													
														
															|  |  		lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Y", _indicator);
 |  |  		lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Y", _indicator);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -		_step_block = testScreen::axisZ;
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_step_block = TestScreen::AxisZ;
 | 
												
													
														
															|  |  		lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Z", _indicator);
 |  |  		lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Z", _indicator);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -		_step_block = testScreen::bed;
 |  | 
 | 
												
													
														
															|  | 
 |  | +		_step_block = TestScreen::Bed;
 | 
												
													
														
															|  |  		lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Bed", _indicator);
 |  |  		lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Bed", _indicator);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -        _step_block = testScreen::hotend;
 |  | 
 | 
												
													
														
															|  | 
 |  | +        _step_block = TestScreen::Hotend;
 | 
												
													
														
															|  |          lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Hotend", _indicator);
 |  |          lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Hotend", _indicator);
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -8138,7 +8083,7 @@ static void menu_action_sdfile(const char* filename)
 | 
												
													
														
															|  |    const char end[5] = ".gco";
 |  |    const char end[5] = ".gco";
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |    //we are storing just first 8 characters of 8.3 filename assuming that extension is always ".gco"
 |  |    //we are storing just first 8 characters of 8.3 filename assuming that extension is always ".gco"
 | 
												
													
														
															|  | -  for (int i = 0; i < 8; i++) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +  for (uint_least8_t i = 0; i < 8; i++) {
 | 
												
													
														
															|  |  	  if (strcmp((cmd + i + 4), end) == 0) { 
 |  |  	  if (strcmp((cmd + i + 4), end) == 0) { 
 | 
												
													
														
															|  |  		  //filename is shorter then 8.3, store '\0' character on position where ".gco" string was found to terminate stored string properly
 |  |  		  //filename is shorter then 8.3, store '\0' character on position where ".gco" string was found to terminate stored string properly
 | 
												
													
														
															|  |   		  eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, '\0');
 |  |   		  eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, '\0');
 | 
												
											
												
													
														
															|  | @@ -8152,8 +8097,8 @@ static void menu_action_sdfile(const char* filename)
 | 
												
													
														
															|  |    uint8_t depth = (uint8_t)card.getWorkDirDepth();
 |  |    uint8_t depth = (uint8_t)card.getWorkDirDepth();
 | 
												
													
														
															|  |    eeprom_write_byte((uint8_t*)EEPROM_DIR_DEPTH, depth);
 |  |    eeprom_write_byte((uint8_t*)EEPROM_DIR_DEPTH, depth);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -  for (uint8_t i = 0; i < depth; i++) {
 |  | 
 | 
												
													
														
															|  | -	  for (int j = 0; j < 8; j++) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +  for (uint_least8_t i = 0; i < depth; i++) {
 | 
												
													
														
															|  | 
 |  | +	  for (uint_least8_t j = 0; j < 8; j++) {
 | 
												
													
														
															|  |  		  eeprom_write_byte((uint8_t*)EEPROM_DIRS + j + 8 * i, dir_names[i][j]);
 |  |  		  eeprom_write_byte((uint8_t*)EEPROM_DIRS + j + 8 * i, dir_names[i][j]);
 | 
												
													
														
															|  |  	  }
 |  |  	  }
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
											
												
													
														
															|  | @@ -8306,13 +8251,19 @@ void lcd_setstatus(const char* message)
 | 
												
													
														
															|  |    strncpy(lcd_status_message, message, LCD_WIDTH);
 |  |    strncpy(lcd_status_message, message, LCD_WIDTH);
 | 
												
													
														
															|  |    lcd_finishstatus();
 |  |    lcd_finishstatus();
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  | 
 |  | +void lcd_updatestatuspgm(const char *message){
 | 
												
													
														
															|  | 
 |  | +	strncpy_P(lcd_status_message, message, LCD_WIDTH);
 | 
												
													
														
															|  | 
 |  | +	lcd_status_message[LCD_WIDTH] = 0;
 | 
												
													
														
															|  | 
 |  | +	lcd_finishstatus();
 | 
												
													
														
															|  | 
 |  | +	// hack lcd_draw_update to 1, i.e. without clear
 | 
												
													
														
															|  | 
 |  | +	lcd_draw_update = 1;
 | 
												
													
														
															|  | 
 |  | +}
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |  void lcd_setstatuspgm(const char* message)
 |  |  void lcd_setstatuspgm(const char* message)
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
													
														
															|  |    if (lcd_status_message_level > 0)
 |  |    if (lcd_status_message_level > 0)
 | 
												
													
														
															|  |      return;
 |  |      return;
 | 
												
													
														
															|  | -  strncpy_P(lcd_status_message, message, LCD_WIDTH);
 |  | 
 | 
												
													
														
															|  | -  lcd_status_message[LCD_WIDTH] = 0;
 |  | 
 | 
												
													
														
															|  | -  lcd_finishstatus();
 |  | 
 | 
												
													
														
															|  | 
 |  | +  lcd_updatestatuspgm(message);
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  void lcd_setalertstatuspgm(const char* message)
 |  |  void lcd_setalertstatuspgm(const char* message)
 | 
												
													
														
															|  |  {
 |  |  {
 | 
												
											
												
													
														
															|  | @@ -8427,5 +8378,5 @@ void menu_lcd_lcdupdate_func(void)
 | 
												
													
														
															|  |  	if (!SdFatUtil::test_stack_integrity()) stack_error();
 |  |  	if (!SdFatUtil::test_stack_integrity()) stack_error();
 | 
												
													
														
															|  |  	lcd_ping(); //check that we have received ping command if we are in farm mode
 |  |  	lcd_ping(); //check that we have received ping command if we are in farm mode
 | 
												
													
														
															|  |  	lcd_send_status();
 |  |  	lcd_send_status();
 | 
												
													
														
															|  | -	if (lcd_commands_type == LCD_COMMAND_V2_CAL) lcd_commands();
 |  | 
 | 
												
													
														
															|  | 
 |  | +	if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands();
 | 
												
													
														
															|  |  }
 |  |  }
 |