|
@@ -40,6 +40,7 @@
|
|
|
|
|
|
#include "static_assert.h"
|
|
|
#include "io_atmega2560.h"
|
|
|
+#include "first_lay_cal.h"
|
|
|
|
|
|
|
|
|
int scrollstuff = 0;
|
|
@@ -73,10 +74,10 @@ extern void crashdet_disable();
|
|
|
bool presort_flag = false;
|
|
|
#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;
|
|
|
|
|
|
|
|
@@ -84,7 +85,7 @@ bool isPrintPaused = false;
|
|
|
uint8_t farm_mode = 0;
|
|
|
int farm_no = 0;
|
|
|
int farm_timer = 8;
|
|
|
-int farm_status = 0;
|
|
|
+uint8_t farm_status = 0;
|
|
|
bool printer_connected = true;
|
|
|
|
|
|
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 prusa_stat_printerstatus(int _status);
|
|
|
static void prusa_stat_farm_number();
|
|
|
+static void prusa_stat_diameter();
|
|
|
static void prusa_stat_temperatures();
|
|
|
static void prusa_stat_printinfo();
|
|
|
static void lcd_farm_no();
|
|
@@ -165,36 +167,71 @@ static bool lcd_selfcheck_pulleys(int axis);
|
|
|
#endif //TMC2130
|
|
|
|
|
|
static bool lcd_selfcheck_check_heater(bool _isbed);
|
|
|
-enum class testScreen
|
|
|
-{
|
|
|
- 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,
|
|
|
};
|
|
|
|
|
|
-static int lcd_selftest_screen(testScreen screen, int _progress, int _progress_scale, bool _clear, int _delay);
|
|
|
+enum class TestError : uint_least8_t
|
|
|
+{
|
|
|
+ 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 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);
|
|
|
+
|
|
|
#ifdef FANCHECK
|
|
|
-static bool lcd_selftest_fan_dialog(int _fan);
|
|
|
+/** Enumerate for lcd_selftest_fan_auto function.
|
|
|
+ */
|
|
|
+enum class FanCheck : uint_least8_t {
|
|
|
+ Success,
|
|
|
+ PrintFan,
|
|
|
+ ExtruderFan,
|
|
|
+ SwappedFan,
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Try to check fan working and wiring.
|
|
|
+ *
|
|
|
+ * @param _fan i fan number 0 means extruder fan, 1 means print fan.
|
|
|
+ *
|
|
|
+ * @returns a TestError noerror, extruderFan, printFan or swappedFan.
|
|
|
+ */
|
|
|
+static FanCheck lcd_selftest_fan_auto(int _fan);
|
|
|
#endif //FANCHECK
|
|
|
+
|
|
|
#ifdef PAT9125
|
|
|
static bool lcd_selftest_fsensor();
|
|
|
#endif //PAT9125
|
|
|
static bool selftest_irsensor();
|
|
|
-static void lcd_selftest_error(int _error_no, const char *_error_1, const char *_error_2);
|
|
|
+static void lcd_selftest_error(TestError error, const char *_error_1, const char *_error_2);
|
|
|
static void lcd_colorprint_change();
|
|
|
#ifdef SNMM
|
|
|
static int get_ext_nr();
|
|
@@ -210,16 +247,21 @@ static char snmm_stop_print_menu();
|
|
|
#ifdef SDCARD_SORT_ALPHA
|
|
|
static void lcd_sort_type_set();
|
|
|
#endif
|
|
|
-static float count_e(float layer_heigth, float extrusion_width, float extrusion_length);
|
|
|
static void lcd_babystep_z();
|
|
|
static void lcd_send_status();
|
|
|
#ifdef FARM_CONNECT_MESSAGE
|
|
|
static void lcd_connect_printer();
|
|
|
#endif //FARM_CONNECT_MESSAGE
|
|
|
|
|
|
+//! Beware: has side effects - forces lcd_draw_update to 2, which means clear the display
|
|
|
void lcd_finishstatus();
|
|
|
|
|
|
static void lcd_sdcard_menu();
|
|
|
+static void lcd_sheet_menu();
|
|
|
+
|
|
|
+static void lcd_select_sheet_0_menu();
|
|
|
+static void lcd_select_sheet_1_menu();
|
|
|
+static void lcd_select_sheet_2_menu();
|
|
|
|
|
|
#ifdef DELTA_CALIBRATION_MENU
|
|
|
static void lcd_delta_calibrate_menu();
|
|
@@ -261,6 +303,8 @@ static void menu_action_sddirectory(const char* filename);
|
|
|
bool lcd_oldcardstatus;
|
|
|
#endif
|
|
|
|
|
|
+uint8_t selected_sheet = 0;
|
|
|
+
|
|
|
bool ignore_click = false;
|
|
|
bool wait_for_unclick;
|
|
|
|
|
@@ -270,6 +314,7 @@ bool wait_for_unclick;
|
|
|
#endif
|
|
|
|
|
|
bool bMain; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function
|
|
|
+bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function
|
|
|
|
|
|
|
|
|
|
|
@@ -281,7 +326,7 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, char* longF
|
|
|
char c;
|
|
|
int enc_dif = lcd_encoder_diff;
|
|
|
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_print(' ');
|
|
|
}
|
|
@@ -529,7 +574,7 @@ void lcdui_print_temp(char type, int val_current, int val_target)
|
|
|
// Print Z-coordinate (8 chars total)
|
|
|
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 --- "));
|
|
|
else
|
|
|
lcd_printf_P(_N("Z%6.2f "), current_position[Z_AXIS]);
|
|
@@ -724,7 +769,7 @@ void lcdui_print_status_line(void)
|
|
|
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(strlen(card.longFilename) > LCD_WIDTH)
|
|
|
{
|
|
@@ -758,10 +803,10 @@ void lcdui_print_status_line(void)
|
|
|
{ // Otherwise check for other special events
|
|
|
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);
|
|
|
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)
|
|
|
{
|
|
|
lcd_set_cursor(0, 3);
|
|
@@ -777,22 +822,22 @@ void lcdui_print_status_line(void)
|
|
|
{
|
|
|
lcd_puts_P(_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 )
|
|
|
{
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P(PSTR(" "));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Calibration done"));////MSG_HOMEYZ_DONE c=0 r=0
|
|
|
+ lcd_puts_P(_i("Calibration done"));////MSG_HOMEYZ_DONE
|
|
|
custom_message_state--;
|
|
|
}
|
|
|
}
|
|
|
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);
|
|
|
break;
|
|
|
- case CUSTOM_MSG_TYPE_PIDCAL: // PID tuning in progress
|
|
|
+ case CustomMsg::PidCal: // PID tuning in progress
|
|
|
lcd_print(lcd_status_message);
|
|
|
if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0)
|
|
|
{
|
|
@@ -802,7 +847,7 @@ void lcdui_print_status_line(void)
|
|
|
lcd_print(itostr3left(pid_number_of_cycles));
|
|
|
}
|
|
|
break;
|
|
|
- case CUSTOM_MSG_TYPE_TEMCAL: // PINDA temp calibration in progress
|
|
|
+ case CustomMsg::TempCal: // PINDA temp calibration in progress
|
|
|
{
|
|
|
char progress[4];
|
|
|
lcd_set_cursor(0, 3);
|
|
@@ -812,7 +857,7 @@ void lcdui_print_status_line(void)
|
|
|
lcd_print(progress);
|
|
|
}
|
|
|
break;
|
|
|
- case CUSTOM_MSG_TYPE_TEMPRE: // temp compensation preheat
|
|
|
+ case CustomMsg::TempCompPreheat: // temp compensation preheat
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P(_i("PINDA Heating"));////MSG_PINDA_PREHEAT c=20 r=1
|
|
|
if (custom_message_state <= PINDA_HEAT_T)
|
|
@@ -951,6 +996,8 @@ static void lcd_status_screen()
|
|
|
{
|
|
|
case 8:
|
|
|
prusa_statistics(21);
|
|
|
+ if(loading_flag)
|
|
|
+ prusa_statistics(22);
|
|
|
break;
|
|
|
case 5:
|
|
|
if (IS_SD_PRINTING)
|
|
@@ -960,7 +1007,7 @@ static void lcd_status_screen()
|
|
|
} // 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 */
|
|
|
- if (lcd_commands_type != LCD_COMMAND_IDLE)
|
|
|
+ if (lcd_commands_type != LcdCommands::Idle)
|
|
|
lcd_commands();
|
|
|
} // end of lcd_draw_update
|
|
|
|
|
@@ -983,7 +1030,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_submenu(lcd_main_menu);
|
|
@@ -1021,23 +1071,25 @@ static void lcd_status_screen()
|
|
|
feedmultiply = 999;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
void lcd_commands()
|
|
|
-{
|
|
|
- if (lcd_commands_type == LCD_COMMAND_LONG_PAUSE)
|
|
|
+{
|
|
|
+ if (lcd_commands_type == LcdCommands::LongPause)
|
|
|
{
|
|
|
if (!blocks_queued() && !homing_flag)
|
|
|
{
|
|
|
lcd_setstatuspgm(_i("Print paused"));////MSG_PRINT_PAUSED c=20 r=1
|
|
|
long_pause();
|
|
|
- lcd_commands_type = 0;
|
|
|
- lcd_commands_step = 0;
|
|
|
+ if (lcd_commands_type == LcdCommands::LongPause) // !!! because "lcd_commands_type" can be changed during/inside "long_pause()"
|
|
|
+ {
|
|
|
+ lcd_commands_type = LcdCommands::Idle;
|
|
|
+ lcd_commands_step = 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#ifdef SNMM
|
|
|
- if (lcd_commands_type == LCD_COMMAND_V2_CAL)
|
|
|
+ if (lcd_commands_type == LcdCommands::Layer1Cal)
|
|
|
{
|
|
|
char cmd1[30];
|
|
|
float width = 0.4;
|
|
@@ -1302,300 +1354,115 @@ void lcd_commands()
|
|
|
|
|
|
#else //if not SNMM
|
|
|
|
|
|
- if (lcd_commands_type == LCD_COMMAND_V2_CAL)
|
|
|
+ if (lcd_commands_type == LcdCommands::Layer1Cal)
|
|
|
{
|
|
|
char cmd1[30];
|
|
|
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
|
|
|
- }
|
|
|
-
|
|
|
- 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;
|
|
|
+ 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;
|
|
|
}
|
|
|
- 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
|
|
|
|
|
|
- if (lcd_commands_type == LCD_COMMAND_STOP_PRINT) /// stop print
|
|
|
+ if (lcd_commands_type == LcdCommands::StopPrint) /// stop print
|
|
|
{
|
|
|
|
|
|
|
|
@@ -1607,9 +1474,9 @@ void lcd_commands()
|
|
|
if (lcd_commands_step == 1 && !blocks_queued())
|
|
|
{
|
|
|
lcd_commands_step = 0;
|
|
|
- lcd_commands_type = 0;
|
|
|
+ lcd_commands_type = LcdCommands::Idle;
|
|
|
lcd_setstatuspgm(_T(WELCOME_MSG));
|
|
|
- custom_message_type = CUSTOM_MSG_TYPE_STATUS;
|
|
|
+ custom_message_type = CustomMsg::Status;
|
|
|
isPrintPaused = false;
|
|
|
}
|
|
|
if (lcd_commands_step == 2 && !blocks_queued())
|
|
@@ -1665,7 +1532,7 @@ void lcd_commands()
|
|
|
if (mmu_enabled)
|
|
|
setAllTargetHotends(0);
|
|
|
manage_heater();
|
|
|
- custom_message_type = CUSTOM_MSG_TYPE_F_LOAD;
|
|
|
+ custom_message_type = CustomMsg::FilamentLoading;
|
|
|
lcd_commands_step = 5;
|
|
|
}
|
|
|
if (lcd_commands_step == 7 && !blocks_queued())
|
|
@@ -1687,12 +1554,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; }
|
|
@@ -1701,7 +1563,7 @@ void lcd_commands()
|
|
|
{
|
|
|
lcd_confirm_print();
|
|
|
lcd_commands_step = 0;
|
|
|
- lcd_commands_type = 0;
|
|
|
+ lcd_commands_type = LcdCommands::Idle;
|
|
|
}
|
|
|
if (lcd_commands_step == 2 && !blocks_queued())
|
|
|
{
|
|
@@ -1734,11 +1596,11 @@ void lcd_commands()
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if (lcd_commands_type == LCD_COMMAND_PID_EXTRUDER) {
|
|
|
+ if (lcd_commands_type == LcdCommands::PidExtruder) {
|
|
|
char cmd1[30];
|
|
|
|
|
|
if (lcd_commands_step == 0) {
|
|
|
- custom_message_type = CUSTOM_MSG_TYPE_PIDCAL;
|
|
|
+ custom_message_type = CustomMsg::PidCal;
|
|
|
custom_message_state = 1;
|
|
|
lcd_draw_update = 3;
|
|
|
lcd_commands_step = 3;
|
|
@@ -1746,6 +1608,7 @@ void lcd_commands()
|
|
|
if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration
|
|
|
strcpy(cmd1, "M303 E0 S");
|
|
|
strcat(cmd1, ftostr3(pid_temp));
|
|
|
+ // setting the correct target temperature (for visualization) is done in PID_autotune
|
|
|
enquecommand(cmd1);
|
|
|
lcd_setstatuspgm(_i("PID cal. "));////MSG_PID_RUNNING c=20 r=1
|
|
|
lcd_commands_step = 2;
|
|
@@ -1754,6 +1617,7 @@ void lcd_commands()
|
|
|
pid_tuning_finished = false;
|
|
|
custom_message_state = 0;
|
|
|
lcd_setstatuspgm(_i("PID cal. finished"));////MSG_PID_FINISHED c=20 r=1
|
|
|
+ setAllTargetHotends(0); // reset all hotends temperature including the number displayed on the main screen
|
|
|
if (_Kp != 0 || _Ki != 0 || _Kd != 0) {
|
|
|
strcpy(cmd1, "M301 P");
|
|
|
strcat(cmd1, ftostr32(_Kp));
|
|
@@ -1772,28 +1636,22 @@ void lcd_commands()
|
|
|
}
|
|
|
if ((lcd_commands_step == 1) && ((_millis()- display_time)>2000)) { //calibration finished message
|
|
|
lcd_setstatuspgm(_T(WELCOME_MSG));
|
|
|
- custom_message_type = CUSTOM_MSG_TYPE_STATUS;
|
|
|
+ custom_message_type = CustomMsg::Status;
|
|
|
pid_temp = DEFAULT_PID_TEMP;
|
|
|
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()
|
|
|
{
|
|
|
lcd_refresh(); // to maybe revive the LCD if static electricity killed it.
|
|
|
menu_goto(lcd_status_screen, 0, false, true);
|
|
|
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
|
|
@@ -1803,10 +1661,11 @@ void lcd_pause_print()
|
|
|
stop_and_save_print_to_ram(0.0,0.0);
|
|
|
setAllTargetHotends(0);
|
|
|
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;
|
|
|
}
|
|
|
+ SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSE); //pause for octoprint
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1920,8 +1779,8 @@ void lcd_menu_extruder_info() // NOT static due to using ins
|
|
|
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
|
|
|
+ lcd_home();
|
|
|
lcd_printf_P(_N(
|
|
|
- ESC_H(0,0)
|
|
|
"%S: %4d RPM\n"
|
|
|
"%S: %4d RPM\n"
|
|
|
),
|
|
@@ -1946,7 +1805,7 @@ void lcd_menu_extruder_info() // NOT static due to using ins
|
|
|
lcd_puts_P(_N("Filament sensor\n" "is disabled."));
|
|
|
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();
|
|
|
lcd_printf_P(_N(
|
|
|
"Fil. Xd:%3d Yd:%3d\n"
|
|
@@ -1982,8 +1841,8 @@ static void lcd_menu_fails_stats_mmu_print()
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
uint8_t fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL);
|
|
|
uint16_t load_fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL);
|
|
|
-// lcd_printf_P(PSTR(ESC_H(0,0) "Last print failures" ESC_H(1,1) "Power failures %-3d" ESC_H(1,2) "Filam. runouts %-3d" ESC_H(1,3) "Crash X %-3d Y %-3d"), power, filam, crashX, crashY);
|
|
|
- lcd_printf_P(PSTR(ESC_H(0,0) "%S" ESC_H(1,1) "%S %-3d" ESC_H(1,2) "%S %-3d" ESC_H(1,3)), _i("Last print failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails);
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d"), _i("Last print failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails);
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
@@ -1999,8 +1858,8 @@ static void lcd_menu_fails_stats_mmu_total()
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
uint8_t fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL_TOT);
|
|
|
uint16_t load_fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL_TOT);
|
|
|
-// lcd_printf_P(PSTR(ESC_H(0,0) "Last print failures" ESC_H(1,1) "Power failures %-3d" ESC_H(1,2) "Filam. runouts %-3d" ESC_H(1,3) "Crash X %-3d Y %-3d"), power, filam, crashX, crashY);
|
|
|
- lcd_printf_P(PSTR(ESC_H(0,0) "%S" ESC_H(1,1) "%S %-3d" ESC_H(1,2) "%S %-3d" ESC_H(1,3) "%S %-3d"), _i("Total failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails, _i("MMU power fails"), mmu_power_failures);
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d\n" " %S %-3d"), _i("Total failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails, _i("MMU power fails"), mmu_power_failures);
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
@@ -2018,8 +1877,8 @@ static void lcd_menu_fails_stats_total()
|
|
|
uint16_t filam = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT);
|
|
|
uint16_t crashX = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT);
|
|
|
uint16_t crashY = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT);
|
|
|
-// lcd_printf_P(PSTR(ESC_H(0,0) "Total failures" ESC_H(1,1) "Power failures %-3d" ESC_H(1,2) "Filam. runouts %-3d" ESC_H(1,3) "Crash X %-3d Y %-3d"), power, filam, crashX, crashY);
|
|
|
- lcd_printf_P(PSTR(ESC_H(0,0) "%S" ESC_H(1,1) "%S %-3d" ESC_H(1,2) "%S %-3d" ESC_H(1,3) "%S X %-3d Y %-3d"), _i("Total failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d\n" " %S X %-3d Y %-3d"), _i("Total failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
@@ -2036,8 +1895,8 @@ static void lcd_menu_fails_stats_print()
|
|
|
uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT);
|
|
|
uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X);
|
|
|
uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y);
|
|
|
-// lcd_printf_P(PSTR(ESC_H(0,0) "Last print failures" ESC_H(1,1) "Power failures %-3d" ESC_H(1,2) "Filam. runouts %-3d" ESC_H(1,3) "Crash X %-3d Y %-3d"), power, filam, crashX, crashY);
|
|
|
- lcd_printf_P(PSTR(ESC_H(0,0) "%S" ESC_H(1,1) "%S %-3d" ESC_H(1,2) "%S %-3d" ESC_H(1,3) "%S X %-3d Y %-3d"), _i("Last print failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d\n" " %S X %-3d Y %-3d"), _i("Last print failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
@@ -2078,7 +1937,8 @@ static void lcd_menu_fails_stats()
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT);
|
|
|
uint16_t filamentTotal = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT);
|
|
|
- lcd_printf_P(PSTR(ESC_H(0,0) "Last print failures" ESC_H(1,1) "Filam. runouts %-3d" ESC_H(0,2) "Total failures" ESC_H(1,3) "Filam. runouts %-3d"), filamentLast, filamentTotal);
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR("Last print failures\n" " Filam. runouts %-3d\n" "Total failures\n" " Filam. runouts %-3d"), filamentLast, filamentTotal);
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
|
#else
|
|
@@ -2102,7 +1962,8 @@ extern char* __malloc_heap_end;
|
|
|
static void lcd_menu_debug()
|
|
|
{
|
|
|
#ifdef DEBUG_STACK_MONITOR
|
|
|
- lcd_printf_P(PSTR(ESC_H(1,1) "RAM statistics" ESC_H(5,1) "SP_min: 0x%04x" ESC_H(1,2) "heap_start: 0x%04x" ESC_H(3,3) "heap_end: 0x%04x"), SP_min, __malloc_heap_start, __malloc_heap_end);
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR("RAM statistics\n" " SP_min: 0x%04x\n" " heap_start: 0x%04x\n" " heap_end: 0x%04x"), SP_min, __malloc_heap_start, __malloc_heap_end);
|
|
|
#endif //DEBUG_STACK_MONITOR
|
|
|
|
|
|
menu_back_if_clicked_fb();
|
|
@@ -2112,12 +1973,12 @@ static void lcd_menu_debug()
|
|
|
static void lcd_menu_temperatures()
|
|
|
{
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
-
|
|
|
- lcd_printf_P(PSTR(ESC_H(1,0) "%S: %d%c" ESC_H(1,1) "%S: %d%c"), _i("Nozzle"), (int)current_temperature[0], '\x01', _i("Bed"), (int)current_temperature_bed, '\x01');
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR(" %S: %d%c \n" " %S: %d%c \n"), _i("Nozzle"), (int)current_temperature[0], '\x01', _i("Bed"), (int)current_temperature_bed, '\x01');
|
|
|
#ifdef AMBIENT_THERMISTOR
|
|
|
- lcd_printf_P(PSTR(ESC_H(1,2) "%S: %d%c" ESC_H(1,3) "PINDA: %d%c"), _i("Ambient"), (int)current_temperature_ambient, '\x01', (int)current_temperature_pinda, '\x01');
|
|
|
+ lcd_printf_P(PSTR(" %S: %d%c\n" " PINDA: %d%c"), _i("Ambient"), (int)current_temperature_ambient, '\x01', (int)current_temperature_pinda, '\x01');
|
|
|
#else //AMBIENT_THERMISTOR
|
|
|
- lcd_printf_P(PSTR(ESC_H(1,2) "PINDA: %d%c"), (int)current_temperature_pinda, '\x01');
|
|
|
+ lcd_printf_P(PSTR(" PINDA: %d%c"), (int)current_temperature_pinda, '\x01');
|
|
|
#endif //AMBIENT_THERMISTOR
|
|
|
|
|
|
menu_back_if_clicked();
|
|
@@ -2133,7 +1994,8 @@ static void lcd_menu_voltages()
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC;
|
|
|
float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC;
|
|
|
- lcd_printf_P(PSTR(ESC_H(1,1)"PWR: %d.%01dV" ESC_H(1,2)"BED: %d.%01dV"), (int)volt_pwr, (int)(10*fabs(volt_pwr - (int)volt_pwr)), (int)volt_bed, (int)(10*fabs(volt_bed - (int)volt_bed)));
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR(" PWR: %d.%01dV\n" " BED: %d.%01dV"), (int)volt_pwr, (int)(10*fabs(volt_pwr - (int)volt_pwr)), (int)volt_bed, (int)(10*fabs(volt_bed - (int)volt_bed)));
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
|
#endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN
|
|
@@ -2141,7 +2003,8 @@ static void lcd_menu_voltages()
|
|
|
#ifdef TMC2130
|
|
|
static void lcd_menu_belt_status()
|
|
|
{
|
|
|
- lcd_printf_P(PSTR(ESC_H(1,0) "%S" ESC_H(2,1) "X %d" ESC_H(2,2) "Y %d" ), _i("Belt status"), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)));
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR("%S\n" " X %d\n" " Y %d"), _i("Belt status"), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)));
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
|
#endif //TMC2130
|
|
@@ -2171,7 +2034,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("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), lcd_preheat_farm_nozzle);
|
|
|
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 {
|
|
|
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);
|
|
@@ -2233,9 +2095,9 @@ static void lcd_support_menu()
|
|
|
MENU_ITEM_BACK_P(PSTR("FW - " FW_version));
|
|
|
}*/
|
|
|
|
|
|
- MENU_ITEM_BACK_P(_i("prusa3d.com"));////MSG_PRUSA3D c=0 r=0
|
|
|
- MENU_ITEM_BACK_P(_i("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=0 r=0
|
|
|
- MENU_ITEM_BACK_P(_i("howto.prusa3d.com"));////MSG_PRUSA3D_HOWTO c=0 r=0
|
|
|
+ MENU_ITEM_BACK_P(_i("prusa3d.com"));////MSG_PRUSA3D
|
|
|
+ MENU_ITEM_BACK_P(_i("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM
|
|
|
+ MENU_ITEM_BACK_P(_i("howto.prusa3d.com"));////MSG_PRUSA3D_HOWTO
|
|
|
MENU_ITEM_BACK_P(STR_SEPARATOR);
|
|
|
MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE));
|
|
|
MENU_ITEM_BACK_P(PSTR(ELECTRONICS));
|
|
@@ -2302,13 +2164,22 @@ void lcd_set_fan_check() {
|
|
|
#ifdef MMU_HAS_CUTTER
|
|
|
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);
|
|
|
}
|
|
|
+#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
|
|
|
{
|
|
|
- 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
|
|
@@ -2323,7 +2194,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 bFilamentPreheatState;
|
|
|
bool bFilamentAction=false;
|
|
@@ -2340,18 +2211,18 @@ lcd_puts_P(_i("Press the knob")); ////MSG_ c=20 r=1
|
|
|
lcd_set_cursor(0,3);
|
|
|
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
|
|
|
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
|
|
|
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;
|
|
|
}
|
|
|
if(lcd_clicked())
|
|
@@ -2365,21 +2236,21 @@ if(lcd_clicked())
|
|
|
menu_back(nLevel);
|
|
|
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
|
|
|
- case e_FILAMENT_ACTION_Load:
|
|
|
+ case FilamentAction::Load:
|
|
|
loading_flag=true;
|
|
|
enquecommand_P(PSTR("M701")); // load filament
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_unLoad:
|
|
|
+ case FilamentAction::UnLoad:
|
|
|
enquecommand_P(PSTR("M702")); // unload filament
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
@@ -2403,19 +2274,19 @@ lcdui_print_temp(LCD_STR_THERMOMETER[0],(int)degHotend(0),(int)degTargetHotend(0
|
|
|
lcd_set_cursor(0,1);
|
|
|
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
|
|
|
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
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuEject:
|
|
|
+ case eFILAMENT_ACTION::mmuEject:
|
|
|
lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuCut:
|
|
|
+ case eFILAMENT_ACTION::mmuCut:
|
|
|
lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
|
|
|
break;
|
|
|
}
|
|
@@ -2434,20 +2305,20 @@ if(lcd_clicked())
|
|
|
setTargetBed((float)nTargetBedOld);
|
|
|
}
|
|
|
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 {
|
|
|
if(current_temperature[0]>(target_temperature[0]*0.95))
|
|
|
{
|
|
|
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);
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuLoad:
|
|
|
+ case eFILAMENT_ACTION::mmuLoad:
|
|
|
nLevel=1;
|
|
|
if(!bFilamentPreheatState)
|
|
|
nLevel++;
|
|
@@ -2455,7 +2326,7 @@ else {
|
|
|
menu_back(nLevel);
|
|
|
menu_submenu(mmu_load_to_nozzle_menu);
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuUnLoad:
|
|
|
+ case eFILAMENT_ACTION::mmuUnLoad:
|
|
|
nLevel=1;
|
|
|
if(!bFilamentPreheatState)
|
|
|
nLevel++;
|
|
@@ -2463,7 +2334,7 @@ else {
|
|
|
menu_back(nLevel);
|
|
|
extr_unload();
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuEject:
|
|
|
+ case eFILAMENT_ACTION::mmuEject:
|
|
|
nLevel=1;
|
|
|
if(!bFilamentPreheatState)
|
|
|
nLevel++;
|
|
@@ -2471,7 +2342,7 @@ else {
|
|
|
menu_back(nLevel);
|
|
|
menu_submenu(mmu_fil_eject_menu);
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuCut:
|
|
|
+ case eFILAMENT_ACTION::mmuCut:
|
|
|
nLevel=1;
|
|
|
if(!bFilamentPreheatState)
|
|
|
nLevel++;
|
|
@@ -2504,44 +2375,44 @@ if(current_temperature[0]>(target_temperature[0]*0.95))
|
|
|
{
|
|
|
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)
|
|
|
menu_submenu(mFilamentPrompt);
|
|
|
else {
|
|
|
nLevel=bFilamentPreheatState?1:2;
|
|
|
menu_back(nLevel);
|
|
|
- if((eFilamentAction==e_FILAMENT_ACTION_Load)||(eFilamentAction==e_FILAMENT_ACTION_autoLoad))
|
|
|
+ if((eFilamentAction==FilamentAction::Load)||(eFilamentAction==FilamentAction::AutoLoad))
|
|
|
{
|
|
|
loading_flag=true;
|
|
|
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
|
|
|
}
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuLoad:
|
|
|
+ case FilamentAction::MmuLoad:
|
|
|
nLevel=bFilamentPreheatState?1:2;
|
|
|
bFilamentAction=true;
|
|
|
menu_back(nLevel);
|
|
|
menu_submenu(mmu_load_to_nozzle_menu);
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuUnLoad:
|
|
|
+ case FilamentAction::MmuUnLoad:
|
|
|
nLevel=bFilamentPreheatState?1:2;
|
|
|
bFilamentAction=true;
|
|
|
menu_back(nLevel);
|
|
|
extr_unload();
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuEject:
|
|
|
+ case FilamentAction::MmuEject:
|
|
|
nLevel=bFilamentPreheatState?1:2;
|
|
|
bFilamentAction=true;
|
|
|
menu_back(nLevel);
|
|
|
menu_submenu(mmu_fil_eject_menu);
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuCut:
|
|
|
+ case FilamentAction::MmuCut:
|
|
|
#ifdef MMU_HAS_CUTTER
|
|
|
nLevel=bFilamentPreheatState?1:2;
|
|
|
bFilamentAction=true;
|
|
@@ -2549,7 +2420,7 @@ if(current_temperature[0]>(target_temperature[0]*0.95))
|
|
|
menu_submenu(mmu_cut_filament_menu);
|
|
|
#endif //MMU_HAS_CUTTER
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_none:
|
|
|
+ case FilamentAction::None:
|
|
|
break;
|
|
|
}
|
|
|
if(bFilamentWaitingFlag)
|
|
@@ -2563,22 +2434,22 @@ else {
|
|
|
lcd_set_cursor(0,1);
|
|
|
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
|
|
|
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
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuEject:
|
|
|
+ case FilamentAction::MmuEject:
|
|
|
lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_mmuCut:
|
|
|
+ case FilamentAction::MmuCut:
|
|
|
lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
|
|
|
break;
|
|
|
- case e_FILAMENT_ACTION_none:
|
|
|
+ case FilamentAction::None:
|
|
|
break;
|
|
|
}
|
|
|
lcd_set_cursor(0,3);
|
|
@@ -2597,8 +2468,8 @@ else {
|
|
|
setTargetBed((float)nTargetBedOld);
|
|
|
}
|
|
|
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
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2643,8 +2514,8 @@ mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP,FLEX_PREHEAT_HPB_TEMP);
|
|
|
void mFilamentBack()
|
|
|
{
|
|
|
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()
|
|
@@ -2675,7 +2546,7 @@ if(0)
|
|
|
enquecommand_P(PSTR("M702")); // unload filament
|
|
|
}
|
|
|
else {
|
|
|
- eFilamentAction=e_FILAMENT_ACTION_unLoad;
|
|
|
+ eFilamentAction=FilamentAction::UnLoad;
|
|
|
bFilamentFirstRun=false;
|
|
|
if(target_temperature[0]>=EXTRUDE_MINTEMP)
|
|
|
{
|
|
@@ -2695,11 +2566,11 @@ void lcd_wait_interact() {
|
|
|
#ifdef SNMM
|
|
|
lcd_puts_P(_i("Prepare new filament"));////MSG_PREPARE_FILAMENT c=20 r=1
|
|
|
#else
|
|
|
- lcd_puts_P(_i("Insert filament"));////MSG_INSERT_FILAMENT c=20 r=0
|
|
|
+ lcd_puts_P(_i("Insert filament"));////MSG_INSERT_FILAMENT c=20
|
|
|
#endif
|
|
|
if (!fsensor_autoload_enabled) {
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("and press the knob"));////MSG_PRESS c=20 r=0
|
|
|
+ lcd_puts_P(_i("and press the knob"));////MSG_PRESS c=20
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2710,18 +2581,18 @@ void lcd_change_success() {
|
|
|
|
|
|
lcd_set_cursor(0, 2);
|
|
|
|
|
|
- lcd_puts_P(_i("Change success!"));////MSG_CHANGE_SUCCESS c=0 r=0
|
|
|
+ lcd_puts_P(_i("Change success!"));////MSG_CHANGE_SUCCESS
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
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_print(".");
|
|
|
//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);
|
|
|
}
|
|
|
}
|
|
@@ -2735,7 +2606,7 @@ void lcd_loading_color() {
|
|
|
|
|
|
lcd_set_cursor(0, 0);
|
|
|
|
|
|
- lcd_puts_P(_i("Loading color"));////MSG_LOADING_COLOR c=0 r=0
|
|
|
+ lcd_puts_P(_i("Loading color"));////MSG_LOADING_COLOR
|
|
|
lcd_set_cursor(0, 2);
|
|
|
lcd_puts_P(_T(MSG_PLEASE_WAIT));
|
|
|
lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence
|
|
@@ -2787,7 +2658,7 @@ void lcd_alright() {
|
|
|
|
|
|
lcd_set_cursor(0, 0);
|
|
|
|
|
|
- lcd_puts_P(_i("Changed correctly?"));////MSG_CORRECTLY c=20 r=0
|
|
|
+ lcd_puts_P(_i("Changed correctly?"));////MSG_CORRECTLY c=20
|
|
|
|
|
|
lcd_set_cursor(1, 1);
|
|
|
|
|
@@ -2795,11 +2666,11 @@ void lcd_alright() {
|
|
|
|
|
|
lcd_set_cursor(1, 2);
|
|
|
|
|
|
- lcd_puts_P(_i("Filament not loaded"));////MSG_NOT_LOADED c=19 r=0
|
|
|
+ lcd_puts_P(_i("Filament not loaded"));////MSG_NOT_LOADED c=19
|
|
|
|
|
|
|
|
|
lcd_set_cursor(1, 3);
|
|
|
- lcd_puts_P(_i("Color not correct"));////MSG_NOT_COLOR c=0 r=0
|
|
|
+ lcd_puts_P(_i("Color not correct"));////MSG_NOT_COLOR
|
|
|
|
|
|
|
|
|
lcd_set_cursor(0, 1);
|
|
@@ -2827,10 +2698,12 @@ void lcd_alright() {
|
|
|
|
|
|
if (cursor_pos > 3) {
|
|
|
cursor_pos = 3;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
}
|
|
|
|
|
|
if (cursor_pos < 1) {
|
|
|
cursor_pos = 1;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
}
|
|
|
lcd_set_cursor(0, 1);
|
|
|
lcd_print(" ");
|
|
@@ -2841,6 +2714,7 @@ void lcd_alright() {
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
lcd_print(">");
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
_delay(100);
|
|
|
}
|
|
|
|
|
@@ -2848,7 +2722,7 @@ void lcd_alright() {
|
|
|
|
|
|
|
|
|
if (lcd_clicked()) {
|
|
|
-
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
lcd_change_fil_state = cursor_pos;
|
|
|
_delay(500);
|
|
|
|
|
@@ -2902,7 +2776,7 @@ static void lcd_LoadFilament()
|
|
|
if(0)
|
|
|
{
|
|
|
// 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;
|
|
|
enquecommand_P(PSTR("M701")); //load filament
|
|
|
SERIAL_ECHOLN("Loading filament");
|
|
@@ -2910,7 +2784,7 @@ if(0)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- eFilamentAction=e_FILAMENT_ACTION_Load;
|
|
|
+ eFilamentAction=FilamentAction::Load;
|
|
|
bFilamentFirstRun=false;
|
|
|
if(target_temperature[0]>=EXTRUDE_MINTEMP)
|
|
|
{
|
|
@@ -2955,18 +2829,13 @@ void lcd_menu_statistics()
|
|
|
const int _m = (_t - (_h * 3600ul)) / 60ul;
|
|
|
const int _s = _t - ((_h * 3600ul) + (_m * 60ul));
|
|
|
|
|
|
+ lcd_clear();
|
|
|
lcd_printf_P(_N(
|
|
|
- ESC_2J
|
|
|
- "%S:"
|
|
|
- ESC_H(6,1) "%8.2fm \n"
|
|
|
- "%S :"
|
|
|
- ESC_H(8,3) "%2dh %02dm %02ds"
|
|
|
- ),
|
|
|
- _i("Filament used"),
|
|
|
- _met,
|
|
|
- _i("Print time"),
|
|
|
- _h, _m, _s
|
|
|
- );
|
|
|
+ "%S:\n"
|
|
|
+ "%8.2fm\n"
|
|
|
+ "%S:\n"
|
|
|
+ "%2dh %02dm %02ds"
|
|
|
+ ),_i("Filament used"), _met, _i("Print time"), _h, _m, _s);
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
else
|
|
@@ -2982,18 +2851,13 @@ void lcd_menu_statistics()
|
|
|
_hours = (_time - (_days * 1440)) / 60;
|
|
|
_minutes = _time - ((_days * 1440) + (_hours * 60));
|
|
|
|
|
|
+ lcd_clear();
|
|
|
lcd_printf_P(_N(
|
|
|
- ESC_2J
|
|
|
- "%S :"
|
|
|
- ESC_H(9,1) "%8.2f m\n"
|
|
|
- "%S :\n"
|
|
|
- "%7ldd :%2hhdh :%02hhd m"
|
|
|
- ),
|
|
|
- _i("Total filament"),
|
|
|
- _filament_m,
|
|
|
- _i("Total print time"),
|
|
|
- _days, _hours, _minutes
|
|
|
- );
|
|
|
+ "%S:\n"
|
|
|
+ "%8.2fm\n"
|
|
|
+ "%S:\n"
|
|
|
+ "%7ldd :%2hhdh :%02hhdm"
|
|
|
+ ), _i("Total filament"), _filament_m, _i("Total print time"), _days, _hours, _minutes);
|
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
while (!lcd_clicked())
|
|
|
{
|
|
@@ -3039,7 +2903,7 @@ static void _lcd_move(const char *name, int axis, int min, int max)
|
|
|
if (lcd_draw_update)
|
|
|
{
|
|
|
lcd_set_cursor(0, 1);
|
|
|
- menu_draw_float31(' ', name, current_position[axis]);
|
|
|
+ menu_draw_float31(name, current_position[axis]);
|
|
|
}
|
|
|
if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious);
|
|
|
if (LCD_CLICKED) menu_back();
|
|
@@ -3064,7 +2928,9 @@ static void lcd_move_e()
|
|
|
if (lcd_draw_update)
|
|
|
{
|
|
|
lcd_set_cursor(0, 1);
|
|
|
- menu_draw_float31(' ', PSTR("Extruder"), current_position[E_AXIS]);
|
|
|
+ // Note: the colon behind the text is necessary to greatly shorten
|
|
|
+ // the implementation of menu_draw_float31
|
|
|
+ menu_draw_float31(PSTR("Extruder:"), current_position[E_AXIS]);
|
|
|
}
|
|
|
if (LCD_CLICKED) menu_back();
|
|
|
}
|
|
@@ -3089,8 +2955,8 @@ static void lcd_menu_xyz_y_min()
|
|
|
//----------------------
|
|
|
float distanceMin[2];
|
|
|
count_xyz_details(distanceMin);
|
|
|
+ lcd_home();
|
|
|
lcd_printf_P(_N(
|
|
|
- ESC_H(0,0)
|
|
|
"%S:\n"
|
|
|
"%S\n"
|
|
|
"%S:\n"
|
|
@@ -3126,8 +2992,8 @@ static void lcd_menu_xyz_skew()
|
|
|
//|Severe skew: 0.25d|
|
|
|
//----------------------
|
|
|
float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW));
|
|
|
+ lcd_home();
|
|
|
lcd_printf_P(_N(
|
|
|
- ESC_H(0,0)
|
|
|
"%S:\n"
|
|
|
"%S\n"
|
|
|
"%S: %5.2f\x01\n"
|
|
@@ -3138,10 +3004,14 @@ static void lcd_menu_xyz_skew()
|
|
|
_i("Slight skew"), _deg(bed_skew_angle_mild),
|
|
|
_i("Severe skew"), _deg(bed_skew_angle_extreme)
|
|
|
);
|
|
|
- if (angleDiff < 100)
|
|
|
- lcd_printf_P(_N(ESC_H(15,0)"%4.2f\x01"), _deg(angleDiff));
|
|
|
- else
|
|
|
- lcd_puts_P(_N(ESC_H(15,0)"N/A"));
|
|
|
+ if (angleDiff < 100){
|
|
|
+ lcd_set_cursor(15,0);
|
|
|
+ lcd_printf_P(_N("%4.2f\x01"), _deg(angleDiff));
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ lcd_set_cursor(15,0);
|
|
|
+ lcd_puts_P(_N("N/A"));
|
|
|
+ }
|
|
|
if (lcd_clicked())
|
|
|
menu_goto(lcd_menu_xyz_offset, 0, true, true);
|
|
|
}
|
|
@@ -3151,7 +3021,7 @@ static void lcd_menu_xyz_skew()
|
|
|
static void lcd_menu_xyz_offset()
|
|
|
{
|
|
|
lcd_set_cursor(0,0);
|
|
|
- lcd_puts_P(_i("[0;0] point offset"));////MSG_MEASURED_OFFSET c=0 r=0
|
|
|
+ lcd_puts_P(_i("[0;0] point offset"));////MSG_MEASURED_OFFSET
|
|
|
lcd_puts_at_P(0, 1, separator);
|
|
|
lcd_puts_at_P(0, 2, PSTR("X"));
|
|
|
lcd_puts_at_P(0, 3, PSTR("Y"));
|
|
@@ -3161,7 +3031,7 @@ static void lcd_menu_xyz_offset()
|
|
|
float cntr[2];
|
|
|
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_print(cntr[i]);
|
|
@@ -3184,14 +3054,16 @@ void EEPROM_read_B(int pos, int* value)
|
|
|
}
|
|
|
|
|
|
|
|
|
+// Note: the colon behind the text (X, Y, Z) is necessary to greatly shorten
|
|
|
+// the implementation of menu_draw_float31
|
|
|
static void lcd_move_x() {
|
|
|
- _lcd_move(PSTR("X"), X_AXIS, X_MIN_POS, X_MAX_POS);
|
|
|
+ _lcd_move(PSTR("X:"), X_AXIS, X_MIN_POS, X_MAX_POS);
|
|
|
}
|
|
|
static void lcd_move_y() {
|
|
|
- _lcd_move(PSTR("Y"), Y_AXIS, Y_MIN_POS, Y_MAX_POS);
|
|
|
+ _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS);
|
|
|
}
|
|
|
static void lcd_move_z() {
|
|
|
- _lcd_move(PSTR("Z"), Z_AXIS, Z_MIN_POS, Z_MAX_POS);
|
|
|
+ _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -3206,13 +3078,13 @@ static void lcd_move_z() {
|
|
|
* other value leads to storing Z_AXIS
|
|
|
* @param msg text to be displayed
|
|
|
*/
|
|
|
-static void _lcd_babystep(int axis, const char *msg)
|
|
|
+static void lcd_babystep_z()
|
|
|
{
|
|
|
typedef struct
|
|
|
- { // 19bytes total
|
|
|
- int8_t status; // 1byte
|
|
|
- int babystepMem[3]; // 6bytes
|
|
|
- float babystepMemMM[3]; // 12bytes
|
|
|
+ {
|
|
|
+ int8_t status;
|
|
|
+ int16_t babystepMemZ;
|
|
|
+ float babystepMemMMZ;
|
|
|
} _menu_data_t;
|
|
|
static_assert(sizeof(menu_data)>= sizeof(_menu_data_t),"_menu_data_t doesn't fit into menu_data");
|
|
|
_menu_data_t* _md = (_menu_data_t*)&(menu_data[0]);
|
|
@@ -3222,18 +3094,20 @@ static void _lcd_babystep(int axis, const char *msg)
|
|
|
// Initialize its status.
|
|
|
_md->status = 1;
|
|
|
check_babystep();
|
|
|
-
|
|
|
- EEPROM_read_B(EEPROM_BABYSTEP_X, &_md->babystepMem[0]);
|
|
|
- EEPROM_read_B(EEPROM_BABYSTEP_Y, &_md->babystepMem[1]);
|
|
|
- EEPROM_read_B(EEPROM_BABYSTEP_Z, &_md->babystepMem[2]);
|
|
|
+
|
|
|
+ if(!is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){
|
|
|
+ _md->babystepMemZ = 0;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ _md->babystepMemZ = eeprom_read_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->
|
|
|
+ s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)));
|
|
|
+ }
|
|
|
|
|
|
// same logic as in babystep_load
|
|
|
if (calibration_status() >= CALIBRATION_STATUS_LIVE_ADJUST)
|
|
|
- _md->babystepMem[2] = 0;
|
|
|
+ _md->babystepMemZ = 0;
|
|
|
|
|
|
- _md->babystepMemMM[0] = _md->babystepMem[0]/cs.axis_steps_per_unit[X_AXIS];
|
|
|
- _md->babystepMemMM[1] = _md->babystepMem[1]/cs.axis_steps_per_unit[Y_AXIS];
|
|
|
- _md->babystepMemMM[2] = _md->babystepMem[2]/cs.axis_steps_per_unit[Z_AXIS];
|
|
|
+ _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_unit[Z_AXIS];
|
|
|
lcd_draw_update = 1;
|
|
|
//SERIAL_ECHO("Z baby step: ");
|
|
|
//SERIAL_ECHO(_md->babystepMem[2]);
|
|
@@ -3244,46 +3118,49 @@ static void _lcd_babystep(int axis, const char *msg)
|
|
|
if (lcd_encoder != 0)
|
|
|
{
|
|
|
if (homing_flag) lcd_encoder = 0;
|
|
|
- _md->babystepMem[axis] += (int)lcd_encoder;
|
|
|
- if (axis == 2)
|
|
|
- {
|
|
|
- if (_md->babystepMem[axis] < Z_BABYSTEP_MIN) _md->babystepMem[axis] = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm
|
|
|
- else if (_md->babystepMem[axis] > Z_BABYSTEP_MAX) _md->babystepMem[axis] = Z_BABYSTEP_MAX; //0
|
|
|
- else
|
|
|
- {
|
|
|
- CRITICAL_SECTION_START
|
|
|
- babystepsTodo[axis] += (int)lcd_encoder;
|
|
|
- CRITICAL_SECTION_END
|
|
|
- }
|
|
|
- }
|
|
|
- _md->babystepMemMM[axis] = _md->babystepMem[axis]/cs.axis_steps_per_unit[axis];
|
|
|
+ _md->babystepMemZ += (int)lcd_encoder;
|
|
|
+
|
|
|
+ if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm
|
|
|
+ else if (_md->babystepMemZ > Z_BABYSTEP_MAX) _md->babystepMemZ = Z_BABYSTEP_MAX; //0
|
|
|
+ else
|
|
|
+ {
|
|
|
+ CRITICAL_SECTION_START
|
|
|
+ babystepsTodo[Z_AXIS] += (int)lcd_encoder;
|
|
|
+ CRITICAL_SECTION_END
|
|
|
+ }
|
|
|
+
|
|
|
+ _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_unit[Z_AXIS];
|
|
|
_delay(50);
|
|
|
lcd_encoder = 0;
|
|
|
lcd_draw_update = 1;
|
|
|
}
|
|
|
if (lcd_draw_update)
|
|
|
{
|
|
|
+ SheetFormatBuffer buffer;
|
|
|
+ menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer);
|
|
|
+ lcd_set_cursor(0, 0);
|
|
|
+ lcd_print(buffer.c);
|
|
|
lcd_set_cursor(0, 1);
|
|
|
- menu_draw_float13(' ', msg, _md->babystepMemMM[axis]);
|
|
|
+ menu_draw_float13(_i("Adjusting Z:"), _md->babystepMemMMZ); ////MSG_BABYSTEPPING_Z c=15 Beware: must include the ':' as its last character
|
|
|
}
|
|
|
if (LCD_CLICKED || menu_leaving)
|
|
|
{
|
|
|
// Only update the EEPROM when leaving the menu.
|
|
|
- EEPROM_save_B(
|
|
|
- (axis == X_AXIS) ? EEPROM_BABYSTEP_X : ((axis == Y_AXIS) ? EEPROM_BABYSTEP_Y : EEPROM_BABYSTEP_Z),
|
|
|
- &_md->babystepMem[axis]);
|
|
|
- if(Z_AXIS == axis) calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
|
|
|
+ eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->
|
|
|
+ s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),
|
|
|
+ _md->babystepMemZ);
|
|
|
+ eeprom_update_byte(&(EEPROM_Sheets_base->s[(eeprom_read_byte(
|
|
|
+ &(EEPROM_Sheets_base->active_sheet)))].bed_temp),
|
|
|
+ target_temperature_bed);
|
|
|
+ eeprom_update_byte(&(EEPROM_Sheets_base->s[(eeprom_read_byte(
|
|
|
+ &(EEPROM_Sheets_base->active_sheet)))].pinda_temp),
|
|
|
+ current_temperature_pinda);
|
|
|
+ calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
|
|
|
}
|
|
|
if (LCD_CLICKED) menu_back();
|
|
|
}
|
|
|
|
|
|
|
|
|
-static void lcd_babystep_z()
|
|
|
-{
|
|
|
- _lcd_babystep(Z_AXIS, (_i("Adjusting Z")));////MSG_BABYSTEPPING_Z c=20 r=0
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
typedef struct
|
|
|
{ // 12bytes + 9bytes = 21bytes total
|
|
|
menu_data_edit_t reserved; //12 bytes reserved for number editing functions
|
|
@@ -3327,20 +3204,19 @@ void lcd_adjust_bed(void)
|
|
|
}
|
|
|
MENU_BEGIN();
|
|
|
// leaving menu - this condition must be immediately before MENU_ITEM_BACK_P
|
|
|
- if (((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving)
|
|
|
- {
|
|
|
+ ON_MENU_LEAVE(
|
|
|
eeprom_update_int8((unsigned char*)EEPROM_BED_CORRECTION_LEFT, _md->left);
|
|
|
eeprom_update_int8((unsigned char*)EEPROM_BED_CORRECTION_RIGHT, _md->right);
|
|
|
eeprom_update_int8((unsigned char*)EEPROM_BED_CORRECTION_FRONT, _md->front);
|
|
|
eeprom_update_int8((unsigned char*)EEPROM_BED_CORRECTION_REAR, _md->rear);
|
|
|
eeprom_update_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID, 1);
|
|
|
- }
|
|
|
- MENU_ITEM_BACK_P(_T(MSG_SETTINGS));
|
|
|
+ );
|
|
|
+ MENU_ITEM_BACK_P(_T(MSG_SETTINGS));
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Left side [um]"), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);////MSG_BED_CORRECTION_LEFT c=14 r=1
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Right side[um]"), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);////MSG_BED_CORRECTION_RIGHT c=14 r=1
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Front side[um]"), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);////MSG_BED_CORRECTION_FRONT c=14 r=1
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Rear side [um]"), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);////MSG_BED_CORRECTION_REAR c=14 r=1
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Reset"), lcd_adjust_bed_reset);////MSG_BED_CORRECTION_RESET c=0 r=0
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Reset"), lcd_adjust_bed_reset);////MSG_BED_CORRECTION_RESET
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
@@ -3356,7 +3232,7 @@ void pid_extruder()
|
|
|
lcd_set_cursor(1, 2);
|
|
|
lcd_print(ftostr3(pid_temp));
|
|
|
if (lcd_clicked()) {
|
|
|
- lcd_commands_type = LCD_COMMAND_PID_EXTRUDER;
|
|
|
+ lcd_commands_type = LcdCommands::PidExtruder;
|
|
|
lcd_return_to_status();
|
|
|
lcd_update(2);
|
|
|
}
|
|
@@ -3373,7 +3249,7 @@ void lcd_adjust_z() {
|
|
|
|
|
|
lcd_clear();
|
|
|
lcd_set_cursor(0, 0);
|
|
|
- lcd_puts_P(_i("Auto adjust Z?"));////MSG_ADJUSTZ c=0 r=0
|
|
|
+ lcd_puts_P(_i("Auto adjust Z?"));////MSG_ADJUSTZ
|
|
|
lcd_set_cursor(1, 1);
|
|
|
lcd_puts_P(_T(MSG_YES));
|
|
|
|
|
@@ -3802,20 +3678,24 @@ int8_t lcd_show_multiscreen_message_two_choices_and_wait_P(const char *msg, bool
|
|
|
lcd_set_cursor(7, 3);
|
|
|
lcd_puts_P((PSTR(">")));
|
|
|
yes = false;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
}
|
|
|
else if (enc_dif > lcd_encoder_diff && !yes) {
|
|
|
lcd_puts_P((PSTR(">")));
|
|
|
lcd_set_cursor(7, 3);
|
|
|
lcd_puts_P((PSTR(" ")));
|
|
|
yes = true;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
}
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
}
|
|
|
else {
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
break; //turning knob skips waiting loop
|
|
|
}
|
|
|
}
|
|
|
if (lcd_clicked()) {
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
if (msg_next == NULL) {
|
|
|
//KEEPALIVE_STATE(IN_HANDLER);
|
|
|
lcd_set_custom_characters();
|
|
@@ -3888,16 +3768,20 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P((PSTR(">")));
|
|
|
yes = false;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
+
|
|
|
}
|
|
|
else if (enc_dif > lcd_encoder_diff && !yes) {
|
|
|
lcd_puts_P((PSTR(">")));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P((PSTR(" ")));
|
|
|
yes = true;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
}
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
}
|
|
|
if (lcd_clicked()) {
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
return yes;
|
|
|
}
|
|
@@ -3958,7 +3842,7 @@ void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, ui
|
|
|
|
|
|
void lcd_temp_cal_show_result(bool result) {
|
|
|
|
|
|
- custom_message_type = CUSTOM_MSG_TYPE_STATUS;
|
|
|
+ custom_message_type = CustomMsg::Status;
|
|
|
disable_x();
|
|
|
disable_y();
|
|
|
disable_z();
|
|
@@ -4076,6 +3960,20 @@ void lcd_menu_show_sensors_state() // NOT static due to using ins
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void prusa_statistics_err(char c){
|
|
|
+ SERIAL_ECHO("{[ERR:");
|
|
|
+ SERIAL_ECHO(c);
|
|
|
+ SERIAL_ECHO(']');
|
|
|
+ prusa_stat_farm_number();
|
|
|
+}
|
|
|
+
|
|
|
+static void prusa_statistics_case0(uint8_t statnr){
|
|
|
+ SERIAL_ECHO("{");
|
|
|
+ prusa_stat_printerstatus(statnr);
|
|
|
+ prusa_stat_farm_number();
|
|
|
+ prusa_stat_printinfo();
|
|
|
+}
|
|
|
+
|
|
|
void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
#ifdef DEBUG_DISABLE_PRUSA_STATISTICS
|
|
|
return;
|
|
@@ -4085,113 +3983,93 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
|
|
|
case 0: // default message
|
|
|
if (busy_state == PAUSED_FOR_USER)
|
|
|
- {
|
|
|
- SERIAL_ECHO("{");
|
|
|
- prusa_stat_printerstatus(15);
|
|
|
- prusa_stat_farm_number();
|
|
|
- prusa_stat_printinfo();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
- status_number = 15;
|
|
|
+ {
|
|
|
+ prusa_statistics_case0(15);
|
|
|
}
|
|
|
else if (isPrintPaused || card.paused)
|
|
|
{
|
|
|
- SERIAL_ECHO("{");
|
|
|
- prusa_stat_printerstatus(14);
|
|
|
- prusa_stat_farm_number();
|
|
|
- prusa_stat_printinfo();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
- status_number = 14;
|
|
|
+ prusa_statistics_case0(14);
|
|
|
}
|
|
|
- else if (IS_SD_PRINTING)
|
|
|
+ else if (IS_SD_PRINTING || loading_flag)
|
|
|
{
|
|
|
- SERIAL_ECHO("{");
|
|
|
- prusa_stat_printerstatus(4);
|
|
|
- prusa_stat_farm_number();
|
|
|
- prusa_stat_printinfo();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
- status_number = 4;
|
|
|
+ prusa_statistics_case0(4);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
SERIAL_ECHO("{");
|
|
|
prusa_stat_printerstatus(1);
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
+ prusa_stat_diameter();
|
|
|
status_number = 1;
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case 1: // 1 heating
|
|
|
farm_status = 2;
|
|
|
- SERIAL_ECHO("{");
|
|
|
+ SERIAL_ECHO('{');
|
|
|
prusa_stat_printerstatus(2);
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
status_number = 2;
|
|
|
farm_timer = 1;
|
|
|
break;
|
|
|
|
|
|
case 2: // heating done
|
|
|
farm_status = 3;
|
|
|
- SERIAL_ECHO("{");
|
|
|
+ SERIAL_ECHO('{');
|
|
|
prusa_stat_printerstatus(3);
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
+ SERIAL_ECHOLN('}');
|
|
|
status_number = 3;
|
|
|
farm_timer = 1;
|
|
|
|
|
|
- if (IS_SD_PRINTING)
|
|
|
+ if (IS_SD_PRINTING || loading_flag)
|
|
|
{
|
|
|
farm_status = 4;
|
|
|
- SERIAL_ECHO("{");
|
|
|
+ SERIAL_ECHO('{');
|
|
|
prusa_stat_printerstatus(4);
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
status_number = 4;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- SERIAL_ECHO("{");
|
|
|
+ SERIAL_ECHO('{');
|
|
|
prusa_stat_printerstatus(3);
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
status_number = 3;
|
|
|
}
|
|
|
farm_timer = 1;
|
|
|
break;
|
|
|
|
|
|
case 3: // filament change
|
|
|
-
|
|
|
+ // must do a return here to prevent doing SERIAL_ECHOLN("}") at the very end of this function
|
|
|
+ // saved a considerable amount of FLASH
|
|
|
+ return;
|
|
|
break;
|
|
|
case 4: // print succesfull
|
|
|
SERIAL_ECHO("{[RES:1][FIL:");
|
|
|
MYSERIAL.print(int(_fil_nr));
|
|
|
- SERIAL_ECHO("]");
|
|
|
+ SERIAL_ECHO(']');
|
|
|
prusa_stat_printerstatus(status_number);
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
|
case 5: // print not succesfull
|
|
|
SERIAL_ECHO("{[RES:0][FIL:");
|
|
|
MYSERIAL.print(int(_fil_nr));
|
|
|
- SERIAL_ECHO("]");
|
|
|
+ SERIAL_ECHO(']');
|
|
|
prusa_stat_printerstatus(status_number);
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
|
case 6: // print done
|
|
|
SERIAL_ECHO("{[PRN:8]");
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
status_number = 8;
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
|
case 7: // print done - stopped
|
|
|
SERIAL_ECHO("{[PRN:9]");
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
status_number = 9;
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
@@ -4199,49 +4077,38 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
SERIAL_ECHO("{[PRN:0][PFN:");
|
|
|
status_number = 0;
|
|
|
SERIAL_ECHO(farm_no);
|
|
|
- SERIAL_ECHOLN("]}");
|
|
|
+ SERIAL_ECHO(']');
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
|
case 20: // echo farm no
|
|
|
- SERIAL_ECHO("{");
|
|
|
+ SERIAL_ECHO('{');
|
|
|
prusa_stat_printerstatus(status_number);
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
farm_timer = 4;
|
|
|
break;
|
|
|
case 21: // temperatures
|
|
|
- SERIAL_ECHO("{");
|
|
|
+ SERIAL_ECHO('{');
|
|
|
prusa_stat_temperatures();
|
|
|
prusa_stat_farm_number();
|
|
|
prusa_stat_printerstatus(status_number);
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
break;
|
|
|
case 22: // waiting for filament change
|
|
|
SERIAL_ECHO("{[PRN:5]");
|
|
|
prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
status_number = 5;
|
|
|
break;
|
|
|
|
|
|
case 90: // Error - Thermal Runaway
|
|
|
- SERIAL_ECHO("{[ERR:1]");
|
|
|
- prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
+ prusa_statistics_err('1');
|
|
|
break;
|
|
|
case 91: // Error - Thermal Runaway Preheat
|
|
|
- SERIAL_ECHO("{[ERR:2]");
|
|
|
- prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
+ prusa_statistics_err('2');
|
|
|
break;
|
|
|
case 92: // Error - Min temp
|
|
|
- SERIAL_ECHO("{[ERR:3]");
|
|
|
- prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
+ prusa_statistics_err('3');
|
|
|
break;
|
|
|
case 93: // Error - Max temp
|
|
|
- SERIAL_ECHO("{[ERR:4]");
|
|
|
- prusa_stat_farm_number();
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
+ prusa_statistics_err('4');
|
|
|
break;
|
|
|
|
|
|
case 99: // heartbeat
|
|
@@ -4249,11 +4116,11 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
prusa_stat_temperatures();
|
|
|
SERIAL_ECHO("[PFN:");
|
|
|
SERIAL_ECHO(farm_no);
|
|
|
- SERIAL_ECHO("]");
|
|
|
- SERIAL_ECHOLN("}");
|
|
|
+ SERIAL_ECHO(']');
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
+ SERIAL_ECHOLN('}');
|
|
|
|
|
|
}
|
|
|
|
|
@@ -4261,13 +4128,19 @@ static void prusa_stat_printerstatus(int _status)
|
|
|
{
|
|
|
SERIAL_ECHO("[PRN:");
|
|
|
SERIAL_ECHO(_status);
|
|
|
- SERIAL_ECHO("]");
|
|
|
+ SERIAL_ECHO(']');
|
|
|
}
|
|
|
|
|
|
static void prusa_stat_farm_number() {
|
|
|
SERIAL_ECHO("[PFN:");
|
|
|
SERIAL_ECHO(farm_no);
|
|
|
- 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()
|
|
@@ -4280,7 +4153,7 @@ static void prusa_stat_temperatures()
|
|
|
SERIAL_ECHO(current_temperature[0]);
|
|
|
SERIAL_ECHO("][ATB:");
|
|
|
SERIAL_ECHO(current_temperature_bed);
|
|
|
- SERIAL_ECHO("]");
|
|
|
+ SERIAL_ECHO(']');
|
|
|
}
|
|
|
|
|
|
static void prusa_stat_printinfo()
|
|
@@ -4304,7 +4177,8 @@ static void prusa_stat_printinfo()
|
|
|
}
|
|
|
SERIAL_ECHO("][FWR:");
|
|
|
SERIAL_ECHO(FW_VERSION);
|
|
|
- SERIAL_ECHO("]");
|
|
|
+ SERIAL_ECHO(']');
|
|
|
+ prusa_stat_diameter();
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -4320,7 +4194,7 @@ void lcd_pick_babystep(){
|
|
|
|
|
|
lcd_set_cursor(0, 0);
|
|
|
|
|
|
- lcd_puts_P(_i("Pick print"));////MSG_PICK_Z c=0 r=0
|
|
|
+ lcd_puts_P(_i("Pick print"));////MSG_PICK_Z
|
|
|
|
|
|
|
|
|
lcd_set_cursor(3, 2);
|
|
@@ -4414,10 +4288,10 @@ void lcd_move_menu_axis()
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_SETTINGS));
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Move X"), lcd_move_x);////MSG_MOVE_X c=0 r=0
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Move Y"), lcd_move_y);////MSG_MOVE_Y c=0 r=0
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Move Z"), lcd_move_z);////MSG_MOVE_Z c=0 r=0
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Extruder"), lcd_move_e);////MSG_MOVE_E c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Move X"), lcd_move_x);////MSG_MOVE_X
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Move Y"), lcd_move_y);////MSG_MOVE_Y
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Move Z"), lcd_move_z);////MSG_MOVE_Z
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Extruder"), lcd_move_e);////MSG_MOVE_E
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
@@ -4469,7 +4343,8 @@ static void lcd_crash_mode_info()
|
|
|
static uint32_t tim = 0;
|
|
|
if ((tim + 1000) < _millis())
|
|
|
{
|
|
|
- fputs_P(_i("\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"), lcdout);////MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
|
|
|
+ lcd_clear();
|
|
|
+ fputs_P(_i("Crash detection can\nbe turned on only in\nNormal mode"), lcdout);////MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
|
|
|
tim = _millis();
|
|
|
}
|
|
|
menu_back_if_clicked();
|
|
@@ -4481,7 +4356,8 @@ static void lcd_crash_mode_info2()
|
|
|
static uint32_t tim = 0;
|
|
|
if ((tim + 1000) < _millis())
|
|
|
{
|
|
|
- fputs_P(_i("\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"), lcdout);////MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
|
|
|
+ lcd_clear();
|
|
|
+ fputs_P(_i("WARNING:\nCrash detection\ndisabled in\nStealth mode"), lcdout);////MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
|
|
|
tim = _millis();
|
|
|
}
|
|
|
menu_back_if_clicked();
|
|
@@ -4579,7 +4455,7 @@ static void lcd_crash_mode_set()
|
|
|
}else{
|
|
|
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);
|
|
|
|
|
|
}
|
|
@@ -4810,25 +4686,26 @@ void lcd_toshiba_flash_air_compatibility_toggle()
|
|
|
|
|
|
void lcd_v2_calibration()
|
|
|
{
|
|
|
+ eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), selected_sheet);
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
const uint8_t filament = choose_menu_P(_i("Select PLA filament:"),_T(MSG_FILAMENT),_i("Cancel")); ////c=20 r=1 ////c=19 r=1
|
|
|
if (filament < 5)
|
|
|
{
|
|
|
lcd_commands_step = 20 + filament;
|
|
|
- lcd_commands_type = LCD_COMMAND_V2_CAL;
|
|
|
+ lcd_commands_type = LcdCommands::Layer1Cal;
|
|
|
}
|
|
|
}
|
|
|
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
|
|
|
if (loaded) {
|
|
|
- lcd_commands_type = LCD_COMMAND_V2_CAL;
|
|
|
+ lcd_commands_type = LcdCommands::Layer1Cal;
|
|
|
}
|
|
|
else {
|
|
|
lcd_display_message_fullscreen_P(_i("Please load PLA filament first."));////MSG_PLEASE_LOAD_PLA c=20 r=4
|
|
|
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);
|
|
|
if (lcd_clicked()) {
|
|
|
break;
|
|
@@ -4921,6 +4798,7 @@ static void lcd_wizard_load()
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("Please insert PLA filament to the first tube of MMU, then press the knob to load it."));////c=20 r=8
|
|
|
+ tmp_extruder = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -4975,9 +4853,21 @@ void lcd_wizard(WizState state)
|
|
|
int wizard_event;
|
|
|
const char *msg = NULL;
|
|
|
while (!end) {
|
|
|
- printf_P(PSTR("Wizard state: %d"), state);
|
|
|
+ printf_P(PSTR("Wizard state: %d\n"), state);
|
|
|
switch (state) {
|
|
|
case S::Run: //Run wizard?
|
|
|
+
|
|
|
+ // 2019-08-07 brutal hack - solving the "viper" situation.
|
|
|
+ // It is caused by the fact, that tmc2130_st_isr makes a crash detection before the printers really starts.
|
|
|
+ // And thus it calles stop_and_save_print_to_ram which sets the saved_printing flag.
|
|
|
+ // Having this flag set during normal printing is lethal - mesh_plan_buffer_line exist in the middle of planning long travels
|
|
|
+ // which results in distorted print.
|
|
|
+ // This primarily happens when the printer is new and parked in 0,0
|
|
|
+ // So any new printer will fail the first layer calibration unless being reset or the Stop function gets called.
|
|
|
+ // We really must find a way to prevent the crash from happening before the printer is started - that would be the correct solution.
|
|
|
+ // Btw. the flag may even trigger the viper situation on normal start this way and the user won't be able to find out why.
|
|
|
+ saved_printing = false;
|
|
|
+
|
|
|
wizard_active = true;
|
|
|
wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Hi, I am your Original Prusa i3 printer. Would you like me to guide you through the setup process?"), false, true);////MSG_WIZARD_WELCOME c=20 r=7
|
|
|
if (wizard_event) {
|
|
@@ -5083,7 +4973,7 @@ void lcd_wizard(WizState state)
|
|
|
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("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();
|
|
|
end = true;
|
|
|
break;
|
|
@@ -5141,20 +5031,19 @@ void lcd_wizard(WizState state)
|
|
|
void lcd_settings_linearity_correction_menu(void)
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
+ ON_MENU_LEAVE(
|
|
|
+ lcd_settings_linearity_correction_menu_save();
|
|
|
+ );
|
|
|
MENU_ITEM_BACK_P(_T(MSG_SETTINGS));
|
|
|
#ifdef TMC2130_LINEARITY_CORRECTION_XYZ
|
|
|
//tmc2130_wave_fac[X_AXIS]
|
|
|
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("X-correct"), &tmc2130_wave_fac[X_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);////MSG_EXTRUDER_CORRECTION c=9 r=0
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Y-correct"), &tmc2130_wave_fac[Y_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);////MSG_EXTRUDER_CORRECTION c=9 r=0
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Z-correct"), &tmc2130_wave_fac[Z_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);////MSG_EXTRUDER_CORRECTION c=9 r=0
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("X-correct:"), &tmc2130_wave_fac[X_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);////MSG_EXTRUDER_CORRECTION c=10
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Y-correct:"), &tmc2130_wave_fac[Y_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);////MSG_EXTRUDER_CORRECTION c=10
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Z-correct:"), &tmc2130_wave_fac[Z_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);////MSG_EXTRUDER_CORRECTION c=10
|
|
|
#endif //TMC2130_LINEARITY_CORRECTION_XYZ
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("E-correct"), &tmc2130_wave_fac[E_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);////MSG_EXTRUDER_CORRECTION c=9 r=0
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("E-correct:"), &tmc2130_wave_fac[E_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);////MSG_EXTRUDER_CORRECTION c=10
|
|
|
MENU_END();
|
|
|
- if(menu_leaving)
|
|
|
- {
|
|
|
- lcd_settings_linearity_correction_menu_save();
|
|
|
- }
|
|
|
}
|
|
|
#endif // TMC2130
|
|
|
|
|
@@ -5167,7 +5056,7 @@ do\
|
|
|
if (fsensor_not_responding && (mmu_enabled == false))\
|
|
|
{\
|
|
|
/* Filament sensor not working*/\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Fil. sensor [N/A]"), lcd_fsensor_state_set);/*////MSG_FSENSOR_NA c=0 r=0*/\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Fil. sensor [N/A]"), lcd_fsensor_state_set);/*////MSG_FSENSOR_NA*/\
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_fsensor_fail);\
|
|
|
}\
|
|
|
else\
|
|
@@ -5241,10 +5130,16 @@ static bool settingsCutter()
|
|
|
{
|
|
|
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
|
|
|
}
|
|
|
+#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
|
|
|
{
|
|
|
if (menu_item_function_P(_i("Cutter [off]"), lcd_cutter_enabled)) return true;//// c=17 r=1
|
|
@@ -5399,8 +5294,8 @@ do\
|
|
|
case e_SOUND_MODE_SILENT:\
|
|
|
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_SILENT),lcd_sound_state_set);\
|
|
|
break;\
|
|
|
- case e_SOUND_MODE_MUTE:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_MUTE),lcd_sound_state_set);\
|
|
|
+ case e_SOUND_MODE_BLIND:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_BLIND),lcd_sound_state_set);\
|
|
|
break;\
|
|
|
default:\
|
|
|
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);\
|
|
@@ -5408,17 +5303,265 @@ do\
|
|
|
}\
|
|
|
while (0)
|
|
|
|
|
|
+//-//
|
|
|
+static void lcd_check_mode_set(void)
|
|
|
+{
|
|
|
+switch(oCheckMode)
|
|
|
+ {
|
|
|
+ case ClCheckMode::_None:
|
|
|
+ oCheckMode=ClCheckMode::_Warn;
|
|
|
+ break;
|
|
|
+ case ClCheckMode::_Warn:
|
|
|
+ oCheckMode=ClCheckMode::_Strict;
|
|
|
+ break;
|
|
|
+ case ClCheckMode::_Strict:
|
|
|
+ oCheckMode=ClCheckMode::_None;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ oCheckMode=ClCheckMode::_None;
|
|
|
+ }
|
|
|
+eeprom_update_byte((uint8_t*)EEPROM_CHECK_MODE,(uint8_t)oCheckMode);
|
|
|
+}
|
|
|
+
|
|
|
+#define SETTINGS_MODE \
|
|
|
+do\
|
|
|
+{\
|
|
|
+ switch(oCheckMode)\
|
|
|
+ {\
|
|
|
+ case ClCheckMode::_None:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Nozzle [none]"),lcd_check_mode_set);\
|
|
|
+ break;\
|
|
|
+ case ClCheckMode::_Warn:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Nozzle [warn]"),lcd_check_mode_set);\
|
|
|
+ break;\
|
|
|
+ case ClCheckMode::_Strict:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Nozzle [strict]"),lcd_check_mode_set);\
|
|
|
+ break;\
|
|
|
+ default:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Nozzle [none]"),lcd_check_mode_set);\
|
|
|
+ }\
|
|
|
+}\
|
|
|
+while (0)
|
|
|
+
|
|
|
+static void lcd_nozzle_diameter_set(void)
|
|
|
+{
|
|
|
+uint16_t nDiameter;
|
|
|
+
|
|
|
+switch(oNozzleDiameter)
|
|
|
+ {
|
|
|
+ case ClNozzleDiameter::_Diameter_250:
|
|
|
+ oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
|
|
|
+ nDiameter=400;
|
|
|
+ break;
|
|
|
+ case ClNozzleDiameter::_Diameter_400:
|
|
|
+ oNozzleDiameter=ClNozzleDiameter::_Diameter_600;
|
|
|
+ nDiameter=600;
|
|
|
+ break;
|
|
|
+ case ClNozzleDiameter::_Diameter_600:
|
|
|
+ oNozzleDiameter=ClNozzleDiameter::_Diameter_250;
|
|
|
+ nDiameter=250;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
|
|
|
+ nDiameter=400;
|
|
|
+ }
|
|
|
+eeprom_update_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER,(uint8_t)oNozzleDiameter);
|
|
|
+eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,nDiameter);
|
|
|
+}
|
|
|
+
|
|
|
+#define SETTINGS_NOZZLE \
|
|
|
+do\
|
|
|
+{\
|
|
|
+ switch(oNozzleDiameter)\
|
|
|
+ {\
|
|
|
+ case ClNozzleDiameter::_Diameter_250:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Nozzle d. [0.25]"),lcd_nozzle_diameter_set);\
|
|
|
+ break;\
|
|
|
+ case ClNozzleDiameter::_Diameter_400:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Nozzle d. [0.40]"),lcd_nozzle_diameter_set);\
|
|
|
+ break;\
|
|
|
+ case ClNozzleDiameter::_Diameter_600:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Nozzle d. [0.60]"),lcd_nozzle_diameter_set);\
|
|
|
+ break;\
|
|
|
+ default:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Nozzle d. [0.40]"),lcd_nozzle_diameter_set);\
|
|
|
+ }\
|
|
|
+}\
|
|
|
+while (0)
|
|
|
+
|
|
|
+static void lcd_check_model_set(void)
|
|
|
+{
|
|
|
+switch(oCheckModel)
|
|
|
+ {
|
|
|
+ case ClCheckModel::_None:
|
|
|
+ oCheckModel=ClCheckModel::_Warn;
|
|
|
+ break;
|
|
|
+ case ClCheckModel::_Warn:
|
|
|
+ oCheckModel=ClCheckModel::_Strict;
|
|
|
+ break;
|
|
|
+ case ClCheckModel::_Strict:
|
|
|
+ oCheckModel=ClCheckModel::_None;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ oCheckModel=ClCheckModel::_None;
|
|
|
+ }
|
|
|
+eeprom_update_byte((uint8_t*)EEPROM_CHECK_MODEL,(uint8_t)oCheckModel);
|
|
|
+}
|
|
|
+
|
|
|
+#define SETTINGS_MODEL \
|
|
|
+do\
|
|
|
+{\
|
|
|
+ switch(oCheckModel)\
|
|
|
+ {\
|
|
|
+ case ClCheckModel::_None:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Model [none]"),lcd_check_model_set);\
|
|
|
+ break;\
|
|
|
+ case ClCheckModel::_Warn:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Model [warn]"),lcd_check_model_set);\
|
|
|
+ break;\
|
|
|
+ case ClCheckModel::_Strict:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Model [strict]"),lcd_check_model_set);\
|
|
|
+ break;\
|
|
|
+ default:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Model [none]"),lcd_check_model_set);\
|
|
|
+ }\
|
|
|
+}\
|
|
|
+while (0)
|
|
|
+
|
|
|
+static void lcd_check_version_set(void)
|
|
|
+{
|
|
|
+switch(oCheckVersion)
|
|
|
+ {
|
|
|
+ case ClCheckVersion::_None:
|
|
|
+ oCheckVersion=ClCheckVersion::_Warn;
|
|
|
+ break;
|
|
|
+ case ClCheckVersion::_Warn:
|
|
|
+ oCheckVersion=ClCheckVersion::_Strict;
|
|
|
+ break;
|
|
|
+ case ClCheckVersion::_Strict:
|
|
|
+ oCheckVersion=ClCheckVersion::_None;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ oCheckVersion=ClCheckVersion::_None;
|
|
|
+ }
|
|
|
+eeprom_update_byte((uint8_t*)EEPROM_CHECK_VERSION,(uint8_t)oCheckVersion);
|
|
|
+}
|
|
|
+
|
|
|
+#define SETTINGS_VERSION \
|
|
|
+do\
|
|
|
+{\
|
|
|
+ switch(oCheckVersion)\
|
|
|
+ {\
|
|
|
+ case ClCheckVersion::_None:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Firmware [none]"),lcd_check_version_set);\
|
|
|
+ break;\
|
|
|
+ case ClCheckVersion::_Warn:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Firmware [warn]"),lcd_check_version_set);\
|
|
|
+ break;\
|
|
|
+ case ClCheckVersion::_Strict:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Firmware [strict]"),lcd_check_version_set);\
|
|
|
+ break;\
|
|
|
+ default:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Firmware [none]"),lcd_check_version_set);\
|
|
|
+ }\
|
|
|
+}\
|
|
|
+while (0)
|
|
|
+
|
|
|
+static void lcd_check_gcode_set(void)
|
|
|
+{
|
|
|
+switch(oCheckGcode)
|
|
|
+ {
|
|
|
+ case ClCheckGcode::_None:
|
|
|
+ oCheckGcode=ClCheckGcode::_Warn;
|
|
|
+ break;
|
|
|
+ case ClCheckGcode::_Warn:
|
|
|
+ oCheckGcode=ClCheckGcode::_Strict;
|
|
|
+ break;
|
|
|
+ case ClCheckGcode::_Strict:
|
|
|
+ oCheckGcode=ClCheckGcode::_None;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ oCheckGcode=ClCheckGcode::_None;
|
|
|
+ }
|
|
|
+eeprom_update_byte((uint8_t*)EEPROM_CHECK_GCODE,(uint8_t)oCheckGcode);
|
|
|
+}
|
|
|
+
|
|
|
+#define SETTINGS_GCODE \
|
|
|
+do\
|
|
|
+{\
|
|
|
+ switch(oCheckGcode)\
|
|
|
+ {\
|
|
|
+ case ClCheckGcode::_None:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Gcode [none]"),lcd_check_gcode_set);\
|
|
|
+ break;\
|
|
|
+ case ClCheckGcode::_Warn:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Gcode [warn]"),lcd_check_gcode_set);\
|
|
|
+ break;\
|
|
|
+ case ClCheckGcode::_Strict:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Gcode [strict]"),lcd_check_gcode_set);\
|
|
|
+ break;\
|
|
|
+ default:\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Gcode [none]"),lcd_check_gcode_set);\
|
|
|
+ }\
|
|
|
+}\
|
|
|
+while (0)
|
|
|
+
|
|
|
+static void lcd_checking_menu(void)
|
|
|
+{
|
|
|
+MENU_BEGIN();
|
|
|
+MENU_ITEM_BACK_P(_T(MSG_HW_SETUP));
|
|
|
+SETTINGS_MODE;
|
|
|
+SETTINGS_MODEL;
|
|
|
+SETTINGS_VERSION;
|
|
|
+//-// temporarily disabled
|
|
|
+//SETTINGS_GCODE;
|
|
|
+MENU_END();
|
|
|
+}
|
|
|
+
|
|
|
+void lcd_hw_setup_menu(void) // can not be "static"
|
|
|
+{
|
|
|
+MENU_BEGIN();
|
|
|
+MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch
|
|
|
+
|
|
|
+//strncpy(buffer,_i("Sheet"),sizeof(buffer));
|
|
|
+//strncpy(buffer,_i(" "),sizeof(buffer));
|
|
|
+//strncpy(buffer,EEPROM_Sheets_base->s[0].name,sizeof(buffer));
|
|
|
+
|
|
|
+//const char* menu = EEPROM_Sheets_base->s[0].name.c_str();
|
|
|
+
|
|
|
+//const char *b = new char(buffer);
|
|
|
+//const char *b = const char *b = new char(buffer);(buffer);
|
|
|
+//printf_P(_N("UVLO - end %d\n"), _millis() - time_start);
|
|
|
+//SERIAL_ECHOPGM(buffer);
|
|
|
+//SERIAL_ECHOPGM(reinterpret_cast<const char*>(buffer));
|
|
|
+//SERIAL_ECHOPGM("lakdjushasdjaljsdakjsdn");
|
|
|
+//char* p = &buffer[0];
|
|
|
+
|
|
|
+//MENU_ITEM_SUBMENU_P(reinterpret_cast<const char*>(p),lcd_sheet_menu);
|
|
|
+
|
|
|
+//delete(b);
|
|
|
+
|
|
|
+MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], lcd_select_sheet_0_menu);
|
|
|
+MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], lcd_select_sheet_1_menu);
|
|
|
+MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], lcd_select_sheet_2_menu);
|
|
|
+
|
|
|
+SETTINGS_NOZZLE;
|
|
|
+MENU_ITEM_SUBMENU_P(_i("Checks"), lcd_checking_menu);
|
|
|
+
|
|
|
+MENU_END();
|
|
|
+}
|
|
|
+
|
|
|
static void lcd_settings_menu()
|
|
|
{
|
|
|
EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Temperature"), lcd_control_temperature_menu);////MSG_TEMPERATURE c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Temperature"), lcd_control_temperature_menu);////MSG_TEMPERATURE
|
|
|
if (!homing_flag)
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Move axis"), lcd_move_menu_1mm);////MSG_MOVE_AXIS c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Move axis"), lcd_move_menu_1mm);////MSG_MOVE_AXIS
|
|
|
if (!isPrintPaused)
|
|
|
- MENU_ITEM_GCODE_P(_i("Disable steppers"), PSTR("M84"));////MSG_DISABLE_STEPPERS c=0 r=0
|
|
|
+ MENU_ITEM_GCODE_P(_i("Disable steppers"), PSTR("M84"));////MSG_DISABLE_STEPPERS
|
|
|
|
|
|
SETTINGS_FILAMENT_SENSOR;
|
|
|
|
|
@@ -5432,6 +5575,13 @@ static void lcd_settings_menu()
|
|
|
MENU_ITEM_FUNCTION_P(_i("Fans check [off]"), lcd_set_fan_check);////MSG_FANS_CHECK_OFF c=17 r=1
|
|
|
|
|
|
SETTINGS_SILENT_MODE;
|
|
|
+
|
|
|
+ if(!farm_mode)
|
|
|
+ {
|
|
|
+ bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("HW Setup"), lcd_hw_setup_menu);////MSG_HW_SETUP
|
|
|
+ }
|
|
|
+
|
|
|
SETTINGS_MMU_MODE;
|
|
|
|
|
|
MENU_ITEM_SUBMENU_P(_i("Mesh bed leveling"), lcd_mesh_bed_leveling_settings);////MSG_MBL_SETTINGS c=18 r=1
|
|
@@ -5456,7 +5606,7 @@ static void lcd_settings_menu()
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);
|
|
|
|
|
|
#if (LANG_MODE != 0)
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);////MSG_LANGUAGE_SELECT c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);////MSG_LANGUAGE_SELECT
|
|
|
#endif //(LANG_MODE != 0)
|
|
|
|
|
|
SETTINGS_SD;
|
|
@@ -5505,33 +5655,33 @@ static void lcd_calibration_menu()
|
|
|
if (!isPrintPaused)
|
|
|
{
|
|
|
MENU_ITEM_FUNCTION_P(_i("Wizard"), lcd_wizard);////MSG_WIZARD c=17 r=1
|
|
|
- MENU_ITEM_SUBMENU_P(_i("First layer cal."), lcd_v2_calibration);////MSG_V2_CALIBRATION c=17 r=1
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_v2_calibration);
|
|
|
MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), PSTR("G28 W"));
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Selftest "), lcd_selftest_v);////MSG_SELFTEST c=0 r=0
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Selftest "), lcd_selftest_v);////MSG_SELFTEST
|
|
|
#ifdef MK1BP
|
|
|
// MK1
|
|
|
// "Calibrate Z"
|
|
|
MENU_ITEM_GCODE_P(_T(MSG_HOMEYZ), PSTR("G28 Z"));
|
|
|
#else //MK1BP
|
|
|
// MK2
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Calibrate XYZ"), lcd_mesh_calibration);////MSG_CALIBRATE_BED c=0 r=0
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Calibrate XYZ"), lcd_mesh_calibration);////MSG_CALIBRATE_BED
|
|
|
// "Calibrate Z" with storing the reference values to EEPROM.
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z);
|
|
|
#ifndef SNMM
|
|
|
//MENU_ITEM_FUNCTION_P(_i("Calibrate E"), lcd_calibrate_extruder);////MSG_CALIBRATE_E c=20 r=1
|
|
|
#endif
|
|
|
// "Mesh Bed Leveling"
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Mesh Bed Leveling"), lcd_mesh_bedleveling);////MSG_MESH_BED_LEVELING c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Mesh Bed Leveling"), lcd_mesh_bedleveling);////MSG_MESH_BED_LEVELING
|
|
|
|
|
|
#endif //MK1BP
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Bed level correct"), lcd_adjust_bed);////MSG_BED_CORRECTION_MENU c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Bed level correct"), lcd_adjust_bed);////MSG_BED_CORRECTION_MENU
|
|
|
MENU_ITEM_SUBMENU_P(_i("PID calibration"), pid_extruder);////MSG_PID_EXTRUDER c=17 r=1
|
|
|
#ifndef TMC2130
|
|
|
MENU_ITEM_SUBMENU_P(_i("Show end stops"), menu_show_end_stops);////MSG_SHOW_END_STOPS c=17 r=1
|
|
|
#endif
|
|
|
#ifndef MK1BP
|
|
|
- MENU_ITEM_GCODE_P(_i("Reset XYZ calibr."), PSTR("M44"));////MSG_CALIBRATE_BED_RESET c=0 r=0
|
|
|
+ MENU_ITEM_GCODE_P(_i("Reset XYZ calibr."), PSTR("M44"));////MSG_CALIBRATE_BED_RESET
|
|
|
#endif //MK1BP
|
|
|
#ifndef SNMM
|
|
|
//MENU_ITEM_FUNCTION_P(MSG_RESET_CALIBRATE_E, lcd_extr_cal_reset);
|
|
@@ -5550,7 +5700,7 @@ void bowden_menu() {
|
|
|
lcd_clear();
|
|
|
lcd_set_cursor(0, 0);
|
|
|
lcd_print(">");
|
|
|
- for (int i = 0; i < 4; i++) {
|
|
|
+ for (uint_least8_t i = 0; i < 4; i++) {
|
|
|
lcd_set_cursor(1, i);
|
|
|
lcd_print("Extruder ");
|
|
|
lcd_print(i);
|
|
@@ -5578,10 +5728,12 @@ void bowden_menu() {
|
|
|
|
|
|
if (cursor_pos > 3) {
|
|
|
cursor_pos = 3;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
}
|
|
|
|
|
|
if (cursor_pos < 0) {
|
|
|
cursor_pos = 0;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
}
|
|
|
|
|
|
lcd_set_cursor(0, 0);
|
|
@@ -5594,13 +5746,13 @@ void bowden_menu() {
|
|
|
lcd_print(" ");
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
lcd_print(">");
|
|
|
-
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
_delay(100);
|
|
|
}
|
|
|
|
|
|
if (lcd_clicked()) {
|
|
|
-
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
lcd_clear();
|
|
|
while (1) {
|
|
|
|
|
@@ -5631,6 +5783,7 @@ void bowden_menu() {
|
|
|
}
|
|
|
_delay(100);
|
|
|
if (lcd_clicked()) {
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
EEPROM_save_B(EEPROM_BOWDEN_LENGTH + cursor_pos * 2, &bowden_length[cursor_pos]);
|
|
|
if (lcd_show_fullscreen_message_yes_no_and_wait_P(PSTR("Continue with another bowden?"))) {
|
|
|
lcd_update_enable(true);
|
|
@@ -5638,7 +5791,7 @@ void bowden_menu() {
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
lcd_print(">");
|
|
|
- for (int i = 0; i < 4; i++) {
|
|
|
+ for (uint_least8_t i = 0; i < 4; i++) {
|
|
|
lcd_set_cursor(1, i);
|
|
|
lcd_print("Extruder ");
|
|
|
lcd_print(i);
|
|
@@ -5676,8 +5829,14 @@ static char snmm_stop_print_menu() { //menu for choosing which filaments will be
|
|
|
if ((abs(enc_dif - lcd_encoder_diff)) > 1) {
|
|
|
if (enc_dif > lcd_encoder_diff) cursor_pos--;
|
|
|
if (enc_dif < lcd_encoder_diff) cursor_pos++;
|
|
|
- if (cursor_pos > 3) cursor_pos = 3;
|
|
|
- if (cursor_pos < 1) cursor_pos = 1;
|
|
|
+ if (cursor_pos > 3) {
|
|
|
+ cursor_pos = 3;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
+ }
|
|
|
+ if (cursor_pos < 1){
|
|
|
+ cursor_pos = 1;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
+ }
|
|
|
|
|
|
lcd_set_cursor(0, 1);
|
|
|
lcd_print(" ");
|
|
@@ -5688,10 +5847,12 @@ static char snmm_stop_print_menu() { //menu for choosing which filaments will be
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
lcd_print(">");
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
_delay(100);
|
|
|
}
|
|
|
}
|
|
|
if (lcd_clicked()) {
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
return(cursor_pos - 1);
|
|
|
}
|
|
@@ -5743,7 +5904,8 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite
|
|
|
}
|
|
|
|
|
|
if (cursor_pos > 3)
|
|
|
- {
|
|
|
+ {
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
cursor_pos = 3;
|
|
|
if (first < items_no - 3)
|
|
|
{
|
|
@@ -5754,6 +5916,7 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite
|
|
|
|
|
|
if (cursor_pos < 1)
|
|
|
{
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
cursor_pos = 1;
|
|
|
if (first > 0)
|
|
|
{
|
|
@@ -5765,14 +5928,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);
|
|
|
|
|
|
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);
|
|
|
}
|
|
|
|
|
|
- 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_print(first + i + 1);
|
|
@@ -5788,11 +5951,12 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite
|
|
|
lcd_print(" ");
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
lcd_print(">");
|
|
|
-
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
_delay(100);
|
|
|
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
lcd_encoder_diff = 0;
|
|
|
return(cursor_pos + first - 1);
|
|
@@ -5826,7 +5990,7 @@ char reset_menu() {
|
|
|
lcd_consume_click();
|
|
|
while (1) {
|
|
|
|
|
|
- for (int i = 0; i < 4; i++) {
|
|
|
+ for (uint_least8_t i = 0; i < 4; i++) {
|
|
|
lcd_set_cursor(1, i);
|
|
|
lcd_print(item[first + i]);
|
|
|
}
|
|
@@ -5847,6 +6011,7 @@ char reset_menu() {
|
|
|
|
|
|
if (cursor_pos > 3) {
|
|
|
cursor_pos = 3;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
if (first < items_no - 4) {
|
|
|
first++;
|
|
|
lcd_clear();
|
|
@@ -5855,6 +6020,7 @@ char reset_menu() {
|
|
|
|
|
|
if (cursor_pos < 0) {
|
|
|
cursor_pos = 0;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
if (first > 0) {
|
|
|
first--;
|
|
|
lcd_clear();
|
|
@@ -5870,6 +6036,7 @@ char reset_menu() {
|
|
|
lcd_print(" ");
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
lcd_print(">");
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
_delay(100);
|
|
|
}
|
|
@@ -5877,6 +6044,7 @@ char reset_menu() {
|
|
|
}
|
|
|
|
|
|
if (lcd_clicked()) {
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
return(cursor_pos + first);
|
|
|
}
|
|
|
|
|
@@ -5901,54 +6069,48 @@ static void lcd_disable_farm_mode()
|
|
|
|
|
|
static void fil_load_menu()
|
|
|
{
|
|
|
- MENU_BEGIN();
|
|
|
- MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load all"), load_all);////MSG_LOAD_ALL c=17 r=0
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 1"), extr_adj_0);////MSG_LOAD_FILAMENT_1 c=17 r=0
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 2"), extr_adj_1);////MSG_LOAD_FILAMENT_2 c=17 r=0
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 3"), extr_adj_2);////MSG_LOAD_FILAMENT_3 c=17 r=0
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 4"), extr_adj_3);////MSG_LOAD_FILAMENT_4 c=17 r=0
|
|
|
-
|
|
|
- if (mmu_enabled)
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 5"), extr_adj_4);
|
|
|
-
|
|
|
- MENU_END();
|
|
|
-}
|
|
|
+ MENU_BEGIN();
|
|
|
+ MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Load all"), load_all); ////MSG_LOAD_ALL c=17
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '1', extr_adj, 0); ////MSG_LOAD_FILAMENT_1 c=16
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '2', extr_adj, 1); ////MSG_LOAD_FILAMENT_2 c=17
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '3', extr_adj, 2); ////MSG_LOAD_FILAMENT_3 c=17
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '4', extr_adj, 3); ////MSG_LOAD_FILAMENT_4 c=17
|
|
|
|
|
|
-template <uint8_t filament>
|
|
|
-static void mmu_load_to_nozzle()
|
|
|
-{
|
|
|
- menu_back();
|
|
|
- lcd_mmu_load_to_nozzle(filament);
|
|
|
+ if (mmu_enabled)
|
|
|
+ {
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '5', extr_adj, 4);
|
|
|
+ }
|
|
|
+ MENU_END();
|
|
|
}
|
|
|
|
|
|
static void mmu_load_to_nozzle_menu()
|
|
|
{
|
|
|
-if(bFilamentAction)
|
|
|
-{
|
|
|
- MENU_BEGIN();
|
|
|
- MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 1"), mmu_load_to_nozzle<0>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 2"), mmu_load_to_nozzle<1>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 3"), mmu_load_to_nozzle<2>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 4"), mmu_load_to_nozzle<3>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 5"), mmu_load_to_nozzle<4>);
|
|
|
- MENU_END();
|
|
|
-}
|
|
|
-else {
|
|
|
- eFilamentAction=e_FILAMENT_ACTION_mmuLoad;
|
|
|
- bFilamentFirstRun=false;
|
|
|
- if(target_temperature[0]>=EXTRUDE_MINTEMP)
|
|
|
- {
|
|
|
- bFilamentPreheatState=true;
|
|
|
- mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
- }
|
|
|
- else mFilamentMenu();
|
|
|
- }
|
|
|
+ if (bFilamentAction)
|
|
|
+ {
|
|
|
+ MENU_BEGIN();
|
|
|
+ MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '1', lcd_mmu_load_to_nozzle, 0);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '2', lcd_mmu_load_to_nozzle, 1);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '3', lcd_mmu_load_to_nozzle, 2);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '4', lcd_mmu_load_to_nozzle, 3);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '5', lcd_mmu_load_to_nozzle, 4);
|
|
|
+ MENU_END();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ eFilamentAction = FilamentAction::MmuLoad;
|
|
|
+ bFilamentFirstRun = false;
|
|
|
+ if (target_temperature[0] >= EXTRUDE_MINTEMP)
|
|
|
+ {
|
|
|
+ bFilamentPreheatState = true;
|
|
|
+ mFilamentItem(target_temperature[0], target_temperature_bed);
|
|
|
+ }
|
|
|
+ else mFilamentMenu();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-template <uint8_t filament>
|
|
|
-static void mmu_eject_filament()
|
|
|
+static void mmu_eject_filament(uint8_t filament)
|
|
|
{
|
|
|
menu_back();
|
|
|
mmu_eject_filament(filament, true);
|
|
@@ -5956,61 +6118,56 @@ static void mmu_eject_filament()
|
|
|
|
|
|
static void mmu_fil_eject_menu()
|
|
|
{
|
|
|
- if(bFilamentAction)
|
|
|
+ if (bFilamentAction)
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Eject filament 1"), mmu_eject_filament<0>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Eject filament 2"), mmu_eject_filament<1>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Eject filament 3"), mmu_eject_filament<2>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Eject filament 4"), mmu_eject_filament<3>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Eject filament 5"), mmu_eject_filament<4>);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '1', mmu_eject_filament, 0);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '2', mmu_eject_filament, 1);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '3', mmu_eject_filament, 2);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '4', mmu_eject_filament, 3);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '5', mmu_eject_filament, 4);
|
|
|
MENU_END();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- eFilamentAction=e_FILAMENT_ACTION_mmuEject;
|
|
|
- bFilamentFirstRun=false;
|
|
|
- if(target_temperature[0]>=EXTRUDE_MINTEMP)
|
|
|
+ eFilamentAction = FilamentAction::MmuEject;
|
|
|
+ bFilamentFirstRun = false;
|
|
|
+ if (target_temperature[0] >= EXTRUDE_MINTEMP)
|
|
|
{
|
|
|
- bFilamentPreheatState=true;
|
|
|
- mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
+ bFilamentPreheatState = true;
|
|
|
+ mFilamentItem(target_temperature[0], target_temperature_bed);
|
|
|
}
|
|
|
else mFilamentMenu();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
#ifdef MMU_HAS_CUTTER
|
|
|
-template <uint8_t filament>
|
|
|
-static void mmu_cut_filament()
|
|
|
-{
|
|
|
- menu_back();
|
|
|
- mmu_cut_filament(filament);
|
|
|
-}
|
|
|
|
|
|
static void mmu_cut_filament_menu()
|
|
|
{
|
|
|
-if(bFilamentAction)
|
|
|
-{
|
|
|
- MENU_BEGIN();
|
|
|
- MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Cut filament 1"), mmu_cut_filament<0>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Cut filament 2"), mmu_cut_filament<1>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Cut filament 3"), mmu_cut_filament<2>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Cut filament 4"), mmu_cut_filament<3>);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Cut filament 5"), mmu_cut_filament<4>);
|
|
|
- MENU_END();
|
|
|
-}
|
|
|
-else {
|
|
|
- eFilamentAction=e_FILAMENT_ACTION_mmuCut;
|
|
|
- bFilamentFirstRun=false;
|
|
|
- if(target_temperature[0]>=EXTRUDE_MINTEMP)
|
|
|
- {
|
|
|
- bFilamentPreheatState=true;
|
|
|
- mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
- }
|
|
|
- else mFilamentMenu();
|
|
|
- }
|
|
|
+ if(bFilamentAction)
|
|
|
+ {
|
|
|
+ MENU_BEGIN();
|
|
|
+ MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ eFilamentAction=FilamentAction::MmuCut;
|
|
|
+ bFilamentFirstRun=false;
|
|
|
+ if(target_temperature[0]>=EXTRUDE_MINTEMP)
|
|
|
+ {
|
|
|
+ bFilamentPreheatState=true;
|
|
|
+ mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
+ }
|
|
|
+ else mFilamentMenu();
|
|
|
+ }
|
|
|
}
|
|
|
#endif //MMU_HAS_CUTTER
|
|
|
|
|
@@ -6019,14 +6176,14 @@ static void fil_unload_menu()
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload all"), extr_unload_all);////MSG_UNLOAD_ALL c=17 r=0
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 1"), extr_unload_0);////MSG_UNLOAD_FILAMENT_1 c=17 r=0
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 2"), extr_unload_1);////MSG_UNLOAD_FILAMENT_2 c=17 r=0
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 3"), extr_unload_2);////MSG_UNLOAD_FILAMENT_3 c=17 r=0
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 4"), extr_unload_3);////MSG_UNLOAD_FILAMENT_4 c=17 r=0
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload all"), extr_unload_all);////MSG_UNLOAD_ALL c=17
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 1"), extr_unload_0);////MSG_UNLOAD_FILAMENT_1 c=17
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 2"), extr_unload_1);////MSG_UNLOAD_FILAMENT_2 c=17
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 3"), extr_unload_2);////MSG_UNLOAD_FILAMENT_3 c=17
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 4"), extr_unload_3);////MSG_UNLOAD_FILAMENT_4 c=17
|
|
|
|
|
|
if (mmu_enabled)
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 5"), extr_unload_4);////MSG_UNLOAD_FILAMENT_5 c=17 r=0
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 5"), extr_unload_4);////MSG_UNLOAD_FILAMENT_5 c=17
|
|
|
|
|
|
MENU_END();
|
|
|
}
|
|
@@ -6047,7 +6204,7 @@ static void change_extr_menu(){
|
|
|
//unload filament for single material printer (used in M702 gcode)
|
|
|
void unload_filament()
|
|
|
{
|
|
|
- custom_message_type = CUSTOM_MSG_TYPE_F_LOAD;
|
|
|
+ custom_message_type = CustomMsg::FilamentLoading;
|
|
|
lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT));
|
|
|
|
|
|
// extr_unload2();
|
|
@@ -6082,7 +6239,7 @@ void unload_filament()
|
|
|
lcd_update_enable(true);
|
|
|
|
|
|
lcd_setstatuspgm(_T(WELCOME_MSG));
|
|
|
- custom_message_type = CUSTOM_MSG_TYPE_STATUS;
|
|
|
+ custom_message_type = CustomMsg::Status;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -6163,7 +6320,7 @@ unsigned char lcd_choose_color() {
|
|
|
item[0] = "Orange";
|
|
|
item[1] = "Black";
|
|
|
//-----------------------------------------------------
|
|
|
- unsigned char active_rows;
|
|
|
+ uint_least8_t active_rows;
|
|
|
static int first = 0;
|
|
|
int enc_dif = 0;
|
|
|
unsigned char cursor_pos = 1;
|
|
@@ -6176,7 +6333,7 @@ unsigned char lcd_choose_color() {
|
|
|
lcd_consume_click();
|
|
|
while (1) {
|
|
|
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_print(item[first + i]);
|
|
|
}
|
|
@@ -6196,6 +6353,7 @@ unsigned char lcd_choose_color() {
|
|
|
|
|
|
if (cursor_pos > active_rows) {
|
|
|
cursor_pos = active_rows;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
if (first < items_no - active_rows) {
|
|
|
first++;
|
|
|
lcd_clear();
|
|
@@ -6204,6 +6362,7 @@ unsigned char lcd_choose_color() {
|
|
|
|
|
|
if (cursor_pos < 1) {
|
|
|
cursor_pos = 1;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
if (first > 0) {
|
|
|
first--;
|
|
|
lcd_clear();
|
|
@@ -6217,12 +6376,14 @@ unsigned char lcd_choose_color() {
|
|
|
lcd_print(" ");
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
lcd_print(">");
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
_delay(100);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (lcd_clicked()) {
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
switch(cursor_pos + first - 1) {
|
|
|
case 0: return 1; break;
|
|
|
case 1: return 0; break;
|
|
@@ -6282,10 +6443,11 @@ void lcd_confirm_print()
|
|
|
}
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
+ filament_type = FARM_FILAMENT_COLOR_NONE;
|
|
|
if (cursor_pos == 1)
|
|
|
{
|
|
|
_ret = 1;
|
|
|
- filament_type = lcd_choose_color();
|
|
|
+// filament_type = lcd_choose_color();
|
|
|
prusa_statistics(4, filament_type);
|
|
|
no_response = true; //we need confirmation by recieving PRUSA thx
|
|
|
important_status = 4;
|
|
@@ -6295,7 +6457,7 @@ void lcd_confirm_print()
|
|
|
if (cursor_pos == 2)
|
|
|
{
|
|
|
_ret = 2;
|
|
|
- filament_type = lcd_choose_color();
|
|
|
+// filament_type = lcd_choose_color();
|
|
|
prusa_statistics(5, filament_type);
|
|
|
no_response = true; //we need confirmation by recieving PRUSA thx
|
|
|
important_status = 5;
|
|
@@ -6330,6 +6492,7 @@ static void lcd_test_menu()
|
|
|
void lcd_resume_print()
|
|
|
{
|
|
|
lcd_return_to_status();
|
|
|
+ lcd_reset_alert_level();
|
|
|
lcd_setstatuspgm(_T(MSG_RESUMING_PRINT));
|
|
|
lcd_reset_alert_level(); //for fan speed error
|
|
|
restore_print_from_ram_and_continue(0.0);
|
|
@@ -6338,6 +6501,128 @@ void lcd_resume_print()
|
|
|
isPrintPaused = false;
|
|
|
}
|
|
|
|
|
|
+static void change_sheet()
|
|
|
+{
|
|
|
+ eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), selected_sheet);
|
|
|
+ menu_back(3);
|
|
|
+}
|
|
|
+
|
|
|
+static void change_sheet_from_menu(){
|
|
|
+ uint8_t next_sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))+1;
|
|
|
+ while(true){
|
|
|
+ if(next_sheet > 2) next_sheet = 0;
|
|
|
+ if(is_sheet_initialized(next_sheet)){
|
|
|
+ eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), next_sheet);
|
|
|
+ selected_sheet = next_sheet;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else if (next_sheet == selected_sheet){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ next_sheet++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ menu_back();
|
|
|
+}
|
|
|
+
|
|
|
+static void lcd_select_sheet_0_menu()
|
|
|
+{
|
|
|
+ selected_sheet = 0;
|
|
|
+ lcd_sheet_menu();
|
|
|
+}
|
|
|
+static void lcd_select_sheet_1_menu()
|
|
|
+{
|
|
|
+ selected_sheet = 1;
|
|
|
+ lcd_sheet_menu();
|
|
|
+}
|
|
|
+static void lcd_select_sheet_2_menu()
|
|
|
+{
|
|
|
+ selected_sheet = 2;
|
|
|
+ lcd_sheet_menu();
|
|
|
+}
|
|
|
+
|
|
|
+static void lcd_rename_sheet_menu()
|
|
|
+{
|
|
|
+ struct MenuData
|
|
|
+ {
|
|
|
+ bool initialized;
|
|
|
+ uint8_t selected;
|
|
|
+ char name[sizeof(Sheet::name)];
|
|
|
+ };
|
|
|
+ static_assert(sizeof(menu_data)>= sizeof(MenuData),"MenuData doesn't fit into menu_data");
|
|
|
+ MenuData* menuData = (MenuData*)&(menu_data[0]);
|
|
|
+
|
|
|
+ if (!menuData->initialized)
|
|
|
+ {
|
|
|
+ eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name));
|
|
|
+ lcd_encoder = menuData->name[0];
|
|
|
+ menuData->initialized = true;
|
|
|
+ }
|
|
|
+ if (lcd_encoder < '\x20') lcd_encoder = '\x20';
|
|
|
+ if (lcd_encoder > '\x7F') lcd_encoder = '\x7F';
|
|
|
+
|
|
|
+ menuData->name[menuData->selected] = lcd_encoder;
|
|
|
+ lcd_set_cursor(0,0);
|
|
|
+ for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i)
|
|
|
+ {
|
|
|
+ lcd_putc(menuData->name[i]);
|
|
|
+ }
|
|
|
+ lcd_set_cursor(menuData->selected, 1);
|
|
|
+ lcd_putc('^');
|
|
|
+ if (lcd_clicked())
|
|
|
+ {
|
|
|
+ if ((menuData->selected + 1u) < sizeof(Sheet::name))
|
|
|
+ {
|
|
|
+ lcd_encoder = menuData->name[++(menuData->selected)];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ eeprom_update_block(menuData->name,
|
|
|
+ EEPROM_Sheets_base->s[selected_sheet].name,
|
|
|
+ sizeof(Sheet::name));
|
|
|
+ menu_back();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+static void lcd_reset_sheet()
|
|
|
+{
|
|
|
+ struct MenuData
|
|
|
+ {
|
|
|
+ bool initialized;
|
|
|
+ uint8_t selected;
|
|
|
+ char name[sizeof(Sheet::name)];
|
|
|
+ };
|
|
|
+ static_assert(sizeof(menu_data)>= sizeof(MenuData),"MenuData doesn't fit into menu_data");
|
|
|
+ MenuData* menuData = (MenuData*)&(menu_data[0]);
|
|
|
+ eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name));
|
|
|
+
|
|
|
+ menuData->initialized = false;
|
|
|
+ strcpy_P(menuData->name, (char *)pgm_read_word(&(defaultSheetNames[selected_sheet])));
|
|
|
+
|
|
|
+
|
|
|
+ eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),0xffff);
|
|
|
+ eeprom_update_block(menuData->name,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name));
|
|
|
+ menu_back(2);
|
|
|
+}
|
|
|
+
|
|
|
+static void lcd_sheet_menu()
|
|
|
+{
|
|
|
+ MENU_BEGIN();
|
|
|
+ MENU_ITEM_BACK_P(_T(MSG_HW_SETUP));
|
|
|
+
|
|
|
+ if(is_sheet_initialized(selected_sheet)){
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Select"), change_sheet); //// c=18
|
|
|
+ }
|
|
|
+
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_v2_calibration);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Rename"), lcd_rename_sheet_menu); //// c=18
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Reset"), lcd_reset_sheet); //// c=18
|
|
|
+
|
|
|
+ MENU_END();
|
|
|
+}
|
|
|
+
|
|
|
static void lcd_main_menu()
|
|
|
{
|
|
|
|
|
@@ -6359,93 +6644,53 @@ static void lcd_main_menu()
|
|
|
MENU_ITEM_FUNCTION_P(PSTR("recover print"), recover_print);
|
|
|
MENU_ITEM_FUNCTION_P(PSTR("power panic"), uvlo_);
|
|
|
#endif //TMC2130_DEBUG
|
|
|
-
|
|
|
- /* if (farm_mode && !IS_SD_PRINTING )
|
|
|
- {
|
|
|
-
|
|
|
- int tempScrool = 0;
|
|
|
- if (lcd_draw_update == 0 && LCD_CLICKED == 0)
|
|
|
- //_delay(100);
|
|
|
- return; // nothing to do (so don't thrash the SD card)
|
|
|
- uint16_t fileCnt = card.getnrfilenames();
|
|
|
-
|
|
|
- card.getWorkDirName();
|
|
|
- if (card.filename[0] == '/')
|
|
|
- {
|
|
|
-#if SDCARDDETECT == -1
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh);
|
|
|
-#endif
|
|
|
- } else {
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir);
|
|
|
- }
|
|
|
-
|
|
|
- for (uint16_t i = 0; i < fileCnt; i++)
|
|
|
- {
|
|
|
- if (menu_item == menu_line)
|
|
|
- {
|
|
|
-#ifndef SDCARD_RATHERRECENTFIRST
|
|
|
- card.getfilename(i);
|
|
|
-#else
|
|
|
- card.getfilename(fileCnt - 1 - i);
|
|
|
-#endif
|
|
|
- if (card.filenameIsDir)
|
|
|
- {
|
|
|
- MENU_ITEM_SDDIR(_T(MSG_CARD_MENU), card.filename, card.longFilename);
|
|
|
- } else {
|
|
|
-
|
|
|
- MENU_ITEM_SDFILE(_T(MSG_CARD_MENU), card.filename, card.longFilename);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- } else {
|
|
|
- MENU_ITEM_DUMMY();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- MENU_ITEM_BACK_P(PSTR("- - - - - - - - -"));
|
|
|
-
|
|
|
-
|
|
|
- }*/
|
|
|
|
|
|
- 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
|
|
|
}
|
|
|
|
|
|
|
|
|
- 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 c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE
|
|
|
} else
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
#ifdef SDSUPPORT
|
|
|
- if (card.cardOK || lcd_commands_type == LCD_COMMAND_V2_CAL)
|
|
|
+ if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal)
|
|
|
{
|
|
|
if (card.isFileOpen())
|
|
|
{
|
|
|
if (mesh_bed_leveling_flag == false && homing_flag == false) {
|
|
|
if (card.sdprinting)
|
|
|
{
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Pause print"), lcd_pause_print);////MSG_PAUSE_PRINT c=0 r=0
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Pause print"), lcd_pause_print);////MSG_PAUSE_PRINT
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT c=0 r=0
|
|
|
+ #ifdef FANCHECK
|
|
|
+ checkFanSpeed(); //Check manually to get most recent fan speed status
|
|
|
+ if(fan_check_error == EFCE_OK)
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
|
|
|
+ #else
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
|
|
|
+ #endif
|
|
|
+
|
|
|
}
|
|
|
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);
|
|
|
}
|
|
|
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);
|
|
|
/*else*/ {
|
|
@@ -6454,22 +6699,22 @@ static void lcd_main_menu()
|
|
|
}
|
|
|
}
|
|
|
#if SDCARDDETECT < 1
|
|
|
- MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user////MSG_CNG_SDCARD c=0 r=0
|
|
|
+ MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user////MSG_CNG_SDCARD
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
} else
|
|
|
{
|
|
|
bMain=true; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function
|
|
|
- MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu);////MSG_NO_CARD c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu);////MSG_NO_CARD
|
|
|
#if SDCARDDETECT < 1
|
|
|
- MENU_ITEM_GCODE_P(_i("Init. SD card"), PSTR("M21")); // Manually initialize the SD-card via user interface////MSG_INIT_SDCARD c=0 r=0
|
|
|
+ MENU_ITEM_GCODE_P(_i("Init. SD card"), PSTR("M21")); // Manually initialize the SD-card via user interface////MSG_INIT_SDCARD
|
|
|
#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)
|
|
|
{
|
|
@@ -6498,7 +6743,7 @@ static void lcd_main_menu()
|
|
|
#endif
|
|
|
#ifdef FILAMENT_SENSOR
|
|
|
if ((fsensor_autoload_enabled == true) && (fsensor_enabled == true) && (mmu_enabled == false))
|
|
|
- MENU_ITEM_SUBMENU_P(_i("AutoLoad filament"), lcd_menu_AutoLoadFilament);////MSG_AUTOLOAD_FILAMENT c=17 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("AutoLoad filament"), lcd_menu_AutoLoadFilament);////MSG_AUTOLOAD_FILAMENT c=17
|
|
|
else
|
|
|
#endif //FILAMENT_SENSOR
|
|
|
{
|
|
@@ -6513,9 +6758,17 @@ static void lcd_main_menu()
|
|
|
|
|
|
}
|
|
|
|
|
|
- if (!is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL))
|
|
|
+ if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal))
|
|
|
+ {
|
|
|
+ if (!farm_mode)
|
|
|
+ {
|
|
|
+ MENU_ITEM_SUBMENU_SELECT_SHEET_E(EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))], change_sheet_from_menu);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal))
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);////MSG_STATISTICS c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);////MSG_STATISTICS
|
|
|
}
|
|
|
|
|
|
#if defined(TMC2130) || defined(FILAMENT_SENSOR)
|
|
@@ -6524,9 +6777,9 @@ static void lcd_main_menu()
|
|
|
if (mmu_enabled) {
|
|
|
MENU_ITEM_SUBMENU_P(_i("Fail stats MMU"), lcd_menu_fails_stats_mmu);
|
|
|
}
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Support"), lcd_support_menu);////MSG_SUPPORT c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Support"), lcd_support_menu);////MSG_SUPPORT
|
|
|
#ifdef LCD_TEST
|
|
|
- MENU_ITEM_SUBMENU_P(_i("W25x20CL init"), lcd_test_menu);////MSG_SUPPORT c=0 r=0
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("W25x20CL init"), lcd_test_menu);////MSG_SUPPORT
|
|
|
#endif //LCD_TEST
|
|
|
|
|
|
MENU_END();
|
|
@@ -6534,11 +6787,7 @@ static void lcd_main_menu()
|
|
|
}
|
|
|
|
|
|
void stack_error() {
|
|
|
- SET_OUTPUT(BEEPER);
|
|
|
-if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
|
|
|
- WRITE(BEEPER, HIGH);
|
|
|
- _delay(1000);
|
|
|
- WRITE(BEEPER, LOW);
|
|
|
+ Sound_MakeCustom(1000,0,true);
|
|
|
lcd_display_message_fullscreen_P(_i("Error - static memory has been overwritten"));////MSG_STACK_ERROR c=20 r=4
|
|
|
//err_triggered = 1;
|
|
|
while (1) delay_keep_alive(1000);
|
|
@@ -6568,8 +6817,8 @@ void stepper_timer_overflow() {
|
|
|
static void lcd_colorprint_change() {
|
|
|
|
|
|
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_return_to_status();
|
|
|
lcd_draw_update = 3;
|
|
@@ -6606,13 +6855,13 @@ static void lcd_tune_menu()
|
|
|
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN)); //1
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Speed"), &feedmultiply, 10, 999);//2////MSG_SPEED c=0 r=0
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Speed"), &feedmultiply, 10, 999);//2////MSG_SPEED
|
|
|
|
|
|
MENU_ITEM_EDIT_int3_P(_T(MSG_NOZZLE), &target_temperature[0], 0, HEATER_0_MAXTEMP - 10);//3
|
|
|
MENU_ITEM_EDIT_int3_P(_T(MSG_BED), &target_temperature_bed, 0, BED_MAXTEMP - 10);//4
|
|
|
|
|
|
MENU_ITEM_EDIT_int3_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255);//5
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Flow"), &extrudemultiply, 10, 999);//6////MSG_FLOW c=0 r=0
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Flow"), &extrudemultiply, 10, 999);//6////MSG_FLOW
|
|
|
#ifdef FILAMENTCHANGEENABLE
|
|
|
MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//7
|
|
|
#endif
|
|
@@ -6630,6 +6879,14 @@ static void lcd_tune_menu()
|
|
|
|
|
|
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
|
|
|
if(!farm_mode)
|
|
|
{
|
|
@@ -6665,8 +6922,8 @@ static void lcd_tune_menu()
|
|
|
case e_SOUND_MODE_SILENT:
|
|
|
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_SILENT),lcd_sound_state_set);
|
|
|
break;
|
|
|
- case e_SOUND_MODE_MUTE:
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_MUTE),lcd_sound_state_set);
|
|
|
+ case e_SOUND_MODE_BLIND:
|
|
|
+ MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_BLIND),lcd_sound_state_set);
|
|
|
break;
|
|
|
default:
|
|
|
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);
|
|
@@ -6707,18 +6964,18 @@ static void lcd_mesh_bed_leveling_settings()
|
|
|
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_SETTINGS));
|
|
|
- if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_toggle); ////MSG_MESH_3x3 c=18 r=0
|
|
|
- else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_toggle); ////MSG_MESH_7x7 c=18 r=0
|
|
|
+ if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_toggle); ////MSG_MESH_3x3 c=18
|
|
|
+ else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_toggle); ////MSG_MESH_7x7 c=18
|
|
|
switch (mbl_z_probe_nr) {
|
|
|
- case 1: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [1]"), mbl_probe_nr_toggle); break; ////MSG_Z_PROBE_NR_1 c=18 r=0
|
|
|
- case 5: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [5]"), mbl_probe_nr_toggle); break; ////MSG_Z_PROBE_NR_1 c=18 r=0
|
|
|
- default: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [3]"), mbl_probe_nr_toggle); break; ////MSG_Z_PROBE_NR_1 c=18 r=0
|
|
|
+ case 1: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [1]"), mbl_probe_nr_toggle); break; ////MSG_Z_PROBE_NR_1 c=18
|
|
|
+ case 5: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [5]"), mbl_probe_nr_toggle); break; ////MSG_Z_PROBE_NR_1 c=18
|
|
|
+ default: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [3]"), mbl_probe_nr_toggle); break; ////MSG_Z_PROBE_NR_1 c=18
|
|
|
}
|
|
|
if (points_nr == 7) {
|
|
|
- if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets comp. [On]"), mbl_magnets_elimination_toggle); ////MSG_MAGNETS_COMP_ON c=18 r=0
|
|
|
- else MENU_ITEM_FUNCTION_P(_i("Magnets comp.[Off]"), mbl_magnets_elimination_toggle); ////MSG_MAGNETS_COMP_OFF c=18 r=0
|
|
|
+ if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets comp. [On]"), mbl_magnets_elimination_toggle); ////MSG_MAGNETS_COMP_ON c=18
|
|
|
+ else MENU_ITEM_FUNCTION_P(_i("Magnets comp.[Off]"), mbl_magnets_elimination_toggle); ////MSG_MAGNETS_COMP_OFF c=18
|
|
|
}
|
|
|
- else menu_item_text_P(_i("Magnets comp.[N/A]")); ////MSG_MAGNETS_COMP_NA c=18 r=0
|
|
|
+ else menu_item_text_P(_i("Magnets comp.[N/A]")); ////MSG_MAGNETS_COMP_NA c=18
|
|
|
MENU_END();
|
|
|
//SETTINGS_MBL_MODE;
|
|
|
}
|
|
@@ -6737,10 +6994,10 @@ static void lcd_control_temperature_menu()
|
|
|
MENU_ITEM_EDIT_int3_P(_T(MSG_NOZZLE), &target_temperature[0], 0, HEATER_0_MAXTEMP - 10);
|
|
|
#endif
|
|
|
#if TEMP_SENSOR_1 != 0
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Nozzle2"), &target_temperature[1], 0, HEATER_1_MAXTEMP - 10);////MSG_NOZZLE1 c=0 r=0
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Nozzle2"), &target_temperature[1], 0, HEATER_1_MAXTEMP - 10);////MSG_NOZZLE1
|
|
|
#endif
|
|
|
#if TEMP_SENSOR_2 != 0
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Nozzle3"), &target_temperature[2], 0, HEATER_2_MAXTEMP - 10);////MSG_NOZZLE2 c=0 r=0
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Nozzle3"), &target_temperature[2], 0, HEATER_2_MAXTEMP - 10);////MSG_NOZZLE2
|
|
|
#endif
|
|
|
#if TEMP_SENSOR_BED != 0
|
|
|
MENU_ITEM_EDIT_int3_P(_T(MSG_BED), &target_temperature_bed, 0, BED_MAXTEMP - 3);
|
|
@@ -6749,9 +7006,9 @@ static void lcd_control_temperature_menu()
|
|
|
#if defined AUTOTEMP && (TEMP_SENSOR_0 != 0)
|
|
|
//MENU_ITEM_EDIT removed, following code must be redesigned if AUTOTEMP enabled
|
|
|
MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
|
|
|
- MENU_ITEM_EDIT(float3, _i(" \002 Min"), &autotemp_min, 0, HEATER_0_MAXTEMP - 10);////MSG_MIN c=0 r=0
|
|
|
- MENU_ITEM_EDIT(float3, _i(" \002 Max"), &autotemp_max, 0, HEATER_0_MAXTEMP - 10);////MSG_MAX c=0 r=0
|
|
|
- MENU_ITEM_EDIT(float32, _i(" \002 Fact"), &autotemp_factor, 0.0, 1.0);////MSG_FACTOR c=0 r=0
|
|
|
+ MENU_ITEM_EDIT(float3, _i(" \002 Min"), &autotemp_min, 0, HEATER_0_MAXTEMP - 10);////MSG_MIN
|
|
|
+ MENU_ITEM_EDIT(float3, _i(" \002 Max"), &autotemp_max, 0, HEATER_0_MAXTEMP - 10);////MSG_MAX
|
|
|
+ MENU_ITEM_EDIT(float32, _i(" \002 Fact"), &autotemp_factor, 0.0, 1.0);////MSG_FACTOR
|
|
|
#endif
|
|
|
|
|
|
MENU_END();
|
|
@@ -6773,6 +7030,11 @@ static void lcd_sd_updir()
|
|
|
|
|
|
void lcd_print_stop()
|
|
|
{
|
|
|
+//-//
|
|
|
+ if(!card.sdprinting)
|
|
|
+ {
|
|
|
+ SERIAL_ECHOLNPGM("// action:cancel"); // for Octoprint
|
|
|
+ }
|
|
|
saved_printing = false;
|
|
|
cancel_heatup = true;
|
|
|
#ifdef MESH_BED_LEVELING
|
|
@@ -6798,7 +7060,7 @@ void lcd_print_stop()
|
|
|
lcd_return_to_status();
|
|
|
lcd_ignore_click(true);
|
|
|
lcd_commands_step = 0;
|
|
|
- lcd_commands_type = LCD_COMMAND_STOP_PRINT;
|
|
|
+ lcd_commands_type = LcdCommands::StopPrint;
|
|
|
// Turn off the print fan
|
|
|
SET_OUTPUT(FAN_PIN);
|
|
|
WRITE(FAN_PIN, 0);
|
|
@@ -6825,6 +7087,7 @@ void lcd_sdcard_stop()
|
|
|
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
if ((int32_t)lcd_encoder == 1)
|
|
|
{
|
|
|
lcd_return_to_status();
|
|
@@ -6901,46 +7164,80 @@ bool lcd_selftest()
|
|
|
{
|
|
|
int _progress = 0;
|
|
|
bool _result = true;
|
|
|
+ bool _swapped_fan = false;
|
|
|
lcd_wait_for_cool_down();
|
|
|
lcd_clear();
|
|
|
- lcd_set_cursor(0, 0); lcd_puts_P(_i("Self test start "));////MSG_SELFTEST_START c=20 r=0
|
|
|
+ lcd_set_cursor(0, 0); lcd_puts_P(_i("Self test start "));////MSG_SELFTEST_START c=20
|
|
|
#ifdef TMC2130
|
|
|
FORCE_HIGH_POWER_START;
|
|
|
#endif // TMC2130
|
|
|
_delay(2000);
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
|
|
|
- _progress = lcd_selftest_screen(testScreen::extruderFan, _progress, 3, true, 2000);
|
|
|
-#if (defined(FANCHECK) && defined(TACH_0))
|
|
|
- _result = lcd_selftest_fan_dialog(0);
|
|
|
+ _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000);
|
|
|
+#if (defined(FANCHECK) && defined(TACH_0))
|
|
|
+ switch (lcd_selftest_fan_auto(0)){ // check extruder Fan
|
|
|
+ case FanCheck::ExtruderFan:
|
|
|
+ _result = false;
|
|
|
+ break;
|
|
|
+ case FanCheck::SwappedFan:
|
|
|
+ _swapped_fan = true;
|
|
|
+ // no break
|
|
|
+ default:
|
|
|
+ _result = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
#else //defined(TACH_0)
|
|
|
_result = lcd_selftest_manual_fan_check(0, false);
|
|
|
+#endif //defined(TACH_0)
|
|
|
if (!_result)
|
|
|
{
|
|
|
- const char *_err;
|
|
|
- lcd_selftest_error(7, _err, _err); //extruder fan not spinning
|
|
|
+ lcd_selftest_error(TestError::ExtruderFan, "", "");
|
|
|
}
|
|
|
-#endif //defined(TACH_0)
|
|
|
-
|
|
|
|
|
|
if (_result)
|
|
|
{
|
|
|
- _progress = lcd_selftest_screen(testScreen::printFan, _progress, 3, true, 2000);
|
|
|
-#if (defined(FANCHECK) && defined(TACH_1))
|
|
|
- _result = lcd_selftest_fan_dialog(1);
|
|
|
+ _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000);
|
|
|
+#if (defined(FANCHECK) && defined(TACH_1))
|
|
|
+ switch (lcd_selftest_fan_auto(1)){ // check print fan
|
|
|
+ case FanCheck::PrintFan:
|
|
|
+ _result = false;
|
|
|
+ break;
|
|
|
+ case FanCheck::SwappedFan:
|
|
|
+ _swapped_fan = true;
|
|
|
+ // no break
|
|
|
+ default:
|
|
|
+ _result = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
#else //defined(TACH_1)
|
|
|
_result = lcd_selftest_manual_fan_check(1, false);
|
|
|
+#endif //defined(TACH_1)
|
|
|
if (!_result)
|
|
|
- {
|
|
|
- lcd_selftest_error(6, 0, 0); //print fan not spinning
|
|
|
+ {
|
|
|
+ lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
-#endif //defined(TACH_1)
|
|
|
+ if (_swapped_fan) {
|
|
|
+ //turn on print fan and check that left extruder fan is not spinning
|
|
|
+ _result = lcd_selftest_manual_fan_check(1, true);
|
|
|
+ if (_result) {
|
|
|
+ //print fan is stil turned on; check that it is spinning
|
|
|
+ _result = lcd_selftest_manual_fan_check(1, false, true);
|
|
|
+ if (!_result){
|
|
|
+ lcd_selftest_error(TestError::PrintFan, "", "");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // fans are swapped
|
|
|
+ lcd_selftest_error(TestError::SwappedFan, "", "");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (_result)
|
|
|
{
|
|
|
- _progress = lcd_selftest_screen(testScreen::fansOk, _progress, 3, true, 2000);
|
|
|
+ _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000);
|
|
|
#ifndef TMC2130
|
|
|
_result = lcd_selfcheck_endstops();
|
|
|
#else
|
|
@@ -6951,7 +7248,7 @@ bool lcd_selftest()
|
|
|
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
|
|
|
- _progress = lcd_selftest_screen(testScreen::axisX, _progress, 3, true, 2000);
|
|
|
+ _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 2000);
|
|
|
#ifdef TMC2130
|
|
|
_result = lcd_selfcheck_axis_sg(X_AXIS);
|
|
|
#else
|
|
@@ -6964,7 +7261,7 @@ bool lcd_selftest()
|
|
|
|
|
|
if (_result)
|
|
|
{
|
|
|
- _progress = lcd_selftest_screen(testScreen::axisX, _progress, 3, true, 0);
|
|
|
+ _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0);
|
|
|
|
|
|
#ifndef TMC2130
|
|
|
_result = lcd_selfcheck_pulleys(X_AXIS);
|
|
@@ -6974,7 +7271,7 @@ bool lcd_selftest()
|
|
|
|
|
|
if (_result)
|
|
|
{
|
|
|
- _progress = lcd_selftest_screen(testScreen::axisY, _progress, 3, true, 1500);
|
|
|
+ _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500);
|
|
|
#ifdef TMC2130
|
|
|
_result = lcd_selfcheck_axis_sg(Y_AXIS);
|
|
|
#else
|
|
@@ -6984,7 +7281,7 @@ bool lcd_selftest()
|
|
|
|
|
|
if (_result)
|
|
|
{
|
|
|
- _progress = lcd_selftest_screen(testScreen::axisZ, _progress, 3, true, 0);
|
|
|
+ _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0);
|
|
|
#ifndef TMC2130
|
|
|
_result = lcd_selfcheck_pulleys(Y_AXIS);
|
|
|
#endif // TMC2130
|
|
@@ -7005,7 +7302,7 @@ bool lcd_selftest()
|
|
|
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);
|
|
|
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);
|
|
|
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) != 1) {
|
|
|
enquecommand_P(PSTR("G28 W"));
|
|
@@ -7019,11 +7316,11 @@ bool lcd_selftest()
|
|
|
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);
|
|
|
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);
|
|
|
- _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);
|
|
|
- _progress = lcd_selftest_screen(testScreen::home, 2, 2, true, 0);
|
|
|
+ _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0);
|
|
|
if (bres)
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1);
|
|
|
_result = bres;
|
|
@@ -7032,18 +7329,18 @@ bool lcd_selftest()
|
|
|
|
|
|
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);
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
}
|
|
|
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
|
|
|
if (_result)
|
|
@@ -7051,20 +7348,20 @@ bool lcd_selftest()
|
|
|
|
|
|
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();
|
|
|
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
|
|
|
{
|
|
|
#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();
|
|
|
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
|
|
|
}
|
|
@@ -7072,11 +7369,11 @@ bool lcd_selftest()
|
|
|
#endif //FILAMENT_SENSOR
|
|
|
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
|
|
|
{
|
|
|
- _progress = lcd_selftest_screen(testScreen::failed, _progress, 3, true, 5000);
|
|
|
+ _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000);
|
|
|
}
|
|
|
lcd_reset_alert_level();
|
|
|
enquecommand_P(PSTR("M84"));
|
|
@@ -7084,7 +7381,7 @@ bool lcd_selftest()
|
|
|
|
|
|
if (_result)
|
|
|
{
|
|
|
- LCD_ALERTMESSAGERPGM(_i("Self test OK"));////MSG_SELFTEST_OK c=0 r=0
|
|
|
+ LCD_ALERTMESSAGERPGM(_i("Self test OK"));////MSG_SELFTEST_OK
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -7179,7 +7476,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
|
|
|
//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]);
|
|
|
if (abs(measured_axis_length[i] - axis_length) > max_error_mm) {
|
|
|
enable_endstops(false);
|
|
@@ -7190,7 +7487,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
if (axis == Y_AXIS) _error_1 = "Y";
|
|
|
if (axis == Z_AXIS) _error_1 = "Z";
|
|
|
|
|
|
- lcd_selftest_error(9, _error_1, NULL);
|
|
|
+ lcd_selftest_error(TestError::Axis, _error_1, "");
|
|
|
current_position[axis] = 0;
|
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
reset_crash_det(axis);
|
|
@@ -7208,7 +7505,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
if (axis == Y_AXIS) _error_1 = "Y";
|
|
|
if (axis == Z_AXIS) _error_1 = "Z";
|
|
|
|
|
|
- lcd_selftest_error(8, _error_1, NULL);
|
|
|
+ lcd_selftest_error(TestError::Pulley, _error_1, "");
|
|
|
current_position[axis] = 0;
|
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
reset_crash_det(axis);
|
|
@@ -7283,7 +7580,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
}
|
|
|
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;
|
|
|
}
|
|
|
|
|
@@ -7315,11 +7612,11 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
|
|
|
if (_travel_done >= _travel)
|
|
|
{
|
|
|
- lcd_selftest_error(5, _error_1, _error_2);
|
|
|
+ lcd_selftest_error(TestError::Endstop, _error_1, _error_2);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lcd_selftest_error(4, _error_1, _error_2);
|
|
|
+ lcd_selftest_error(TestError::Motor, _error_1, _error_2);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -7359,7 +7656,7 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
st_synchronize();
|
|
|
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
|
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
|
|
|
- lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
|
|
|
+ lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
|
|
|
return(false);
|
|
|
}
|
|
|
}
|
|
@@ -7377,7 +7674,7 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
return(true);
|
|
|
}
|
|
|
else {
|
|
|
- lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
|
|
|
+ lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
|
|
|
return(false);
|
|
|
}
|
|
|
}
|
|
@@ -7386,7 +7683,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);
|
|
|
st_synchronize();
|
|
|
if (_millis() > timeout_counter) {
|
|
|
- lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
|
|
|
+ lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
|
|
|
return(false);
|
|
|
}
|
|
|
}
|
|
@@ -7419,7 +7716,7 @@ static bool lcd_selfcheck_endstops()
|
|
|
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(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z");
|
|
|
- lcd_selftest_error(3, _error, "");
|
|
|
+ lcd_selftest_error(TestError::Endstops, _error, "");
|
|
|
}
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
@@ -7450,7 +7747,7 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
|
|
|
|
|
|
manage_heater();
|
|
|
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) {
|
|
|
MYSERIAL.print("Bed temp:");
|
|
|
MYSERIAL.println(degBed());
|
|
@@ -7485,12 +7782,12 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lcd_selftest_error(1, "", "");
|
|
|
+ lcd_selftest_error(TestError::Heater, "", "");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lcd_selftest_error(2, "", "");
|
|
|
+ lcd_selftest_error(TestError::Bed, "", "");
|
|
|
}
|
|
|
|
|
|
manage_heater();
|
|
@@ -7499,7 +7796,7 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
|
|
|
return _stepresult;
|
|
|
|
|
|
}
|
|
|
-static void lcd_selftest_error(int _error_no, const char *_error_1, const char *_error_2)
|
|
|
+static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2)
|
|
|
{
|
|
|
lcd_beeper_quick_feedback();
|
|
|
|
|
@@ -7511,43 +7808,43 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
|
|
|
lcd_clear();
|
|
|
|
|
|
lcd_set_cursor(0, 0);
|
|
|
- lcd_puts_P(_i("Selftest error !"));////MSG_SELFTEST_ERROR c=0 r=0
|
|
|
+ lcd_puts_P(_i("Selftest error !"));////MSG_SELFTEST_ERROR
|
|
|
lcd_set_cursor(0, 1);
|
|
|
- lcd_puts_P(_i("Please check :"));////MSG_SELFTEST_PLEASECHECK c=0 r=0
|
|
|
+ lcd_puts_P(_i("Please check :"));////MSG_SELFTEST_PLEASECHECK
|
|
|
|
|
|
- switch (_error_no)
|
|
|
+ switch (testError)
|
|
|
{
|
|
|
- case 1:
|
|
|
+ case TestError::Heater:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Heater/Thermistor"));////MSG_SELFTEST_HEATERTHERMISTOR c=0 r=0
|
|
|
+ lcd_puts_P(_i("Heater/Thermistor"));////MSG_SELFTEST_HEATERTHERMISTOR
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Not connected"));////MSG_SELFTEST_NOTCONNECTED c=0 r=0
|
|
|
+ lcd_puts_P(_i("Not connected"));////MSG_SELFTEST_NOTCONNECTED
|
|
|
break;
|
|
|
- case 2:
|
|
|
+ case TestError::Bed:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Bed / Heater"));////MSG_SELFTEST_BEDHEATER c=0 r=0
|
|
|
+ lcd_puts_P(_i("Bed / Heater"));////MSG_SELFTEST_BEDHEATER
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case TestError::Endstops:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Endstops"));////MSG_SELFTEST_ENDSTOPS c=0 r=0
|
|
|
+ lcd_puts_P(_i("Endstops"));////MSG_SELFTEST_ENDSTOPS
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
lcd_set_cursor(17, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
- case 4:
|
|
|
+ case TestError::Motor:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
lcd_puts_P(_T(MSG_SELFTEST_MOTOR));
|
|
|
lcd_set_cursor(18, 2);
|
|
|
lcd_print(_error_1);
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Endstop"));////MSG_SELFTEST_ENDSTOP c=0 r=0
|
|
|
+ lcd_puts_P(_i("Endstop"));////MSG_SELFTEST_ENDSTOP
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_2);
|
|
|
break;
|
|
|
- case 5:
|
|
|
+ case TestError::Endstop:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
lcd_puts_P(_i("Endstop not hit"));////MSG_SELFTEST_ENDSTOP_NOTHIT c=20 r=1
|
|
|
lcd_set_cursor(0, 3);
|
|
@@ -7555,7 +7852,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
- case 6:
|
|
|
+ case TestError::PrintFan:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
lcd_puts_P(_T(MSG_SELFTEST_COOLING_FAN));
|
|
|
lcd_set_cursor(0, 3);
|
|
@@ -7563,7 +7860,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
- case 7:
|
|
|
+ case TestError::ExtruderFan:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
lcd_puts_P(_T(MSG_SELFTEST_EXTRUDER_FAN));
|
|
|
lcd_set_cursor(0, 3);
|
|
@@ -7571,7 +7868,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
- case 8:
|
|
|
+ case TestError::Pulley:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
lcd_puts_P(_i("Loose pulley"));////MSG_LOOSE_PULLEY c=20 r=1
|
|
|
lcd_set_cursor(0, 3);
|
|
@@ -7579,28 +7876,34 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
- case 9:
|
|
|
+ case TestError::Axis:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Axis length"));////MSG_SELFTEST_AXIS_LENGTH c=0 r=0
|
|
|
+ lcd_puts_P(_i("Axis length"));////MSG_SELFTEST_AXIS_LENGTH
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Axis"));////MSG_SELFTEST_AXIS c=0 r=0
|
|
|
+ lcd_puts_P(_i("Axis"));////MSG_SELFTEST_AXIS
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
- case 10:
|
|
|
+ case TestError::SwappedFan:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Front/left fans"));////MSG_SELFTEST_FANS c=0 r=0
|
|
|
+ lcd_puts_P(_i("Front/left fans"));////MSG_SELFTEST_FANS
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Swapped"));////MSG_SELFTEST_SWAPPED c=0 r=0
|
|
|
+ lcd_puts_P(_i("Swapped"));////MSG_SELFTEST_SWAPPED
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
- case 11:
|
|
|
+ case TestError::WiringFsensor:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Filament sensor"));////MSG_FILAMENT_SENSOR c=20 r=0
|
|
|
+ lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
break;
|
|
|
+ case TestError::TriggeringFsensor:
|
|
|
+ lcd_set_cursor(0, 2);
|
|
|
+ lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
+ lcd_set_cursor(0, 3);
|
|
|
+ lcd_puts_P(_i("False triggering"));////c=20
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
_delay(1000);
|
|
@@ -7624,7 +7927,7 @@ static bool lcd_selftest_fsensor(void)
|
|
|
fsensor_init();
|
|
|
if (fsensor_not_responding)
|
|
|
{
|
|
|
- lcd_selftest_error(11, NULL, NULL);
|
|
|
+ lcd_selftest_error(TestError::WiringFsensor, "", "");
|
|
|
}
|
|
|
return (!fsensor_not_responding);
|
|
|
}
|
|
@@ -7662,21 +7965,25 @@ static bool selftest_irsensor()
|
|
|
TempBackup tempBackup;
|
|
|
setTargetHotend(ABS_PREHEAT_HOTEND_TEMP,active_extruder);
|
|
|
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();
|
|
|
}
|
|
|
- progress = lcd_selftest_screen(testScreen::fsensor, progress, 1, true, 0);
|
|
|
+ progress = lcd_selftest_screen(TestScreen::Fsensor, progress, 1, true, 0);
|
|
|
mmu_command(MmuCmd::U0);
|
|
|
manage_response(false, false);
|
|
|
|
|
|
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);
|
|
|
while (blocks_queued())
|
|
|
{
|
|
|
- if (PIN_GET(IR_SENSOR_PIN) == 0) return false;
|
|
|
+ if (PIN_GET(IR_SENSOR_PIN) == 0)
|
|
|
+ {
|
|
|
+ lcd_selftest_error(TestError::TriggeringFsensor, "", "");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
#ifdef TMC2130
|
|
|
manage_heater();
|
|
|
// Vojtech: Don't disable motors inside the planner!
|
|
@@ -7695,19 +8002,20 @@ static bool selftest_irsensor()
|
|
|
}
|
|
|
#endif //FILAMENT_SENSOR
|
|
|
|
|
|
-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)
|
|
|
{
|
|
|
|
|
|
bool _result = check_opposite;
|
|
|
lcd_clear();
|
|
|
|
|
|
lcd_set_cursor(0, 0); lcd_puts_P(_T(MSG_SELFTEST_FAN));
|
|
|
-
|
|
|
+
|
|
|
switch (_fan)
|
|
|
{
|
|
|
case 0:
|
|
|
// extruder cooling fan
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
+ lcd_set_cursor(0, 1);
|
|
|
if(check_opposite == true) lcd_puts_P(_T(MSG_SELFTEST_COOLING_FAN));
|
|
|
else lcd_puts_P(_T(MSG_SELFTEST_EXTRUDER_FAN));
|
|
|
SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
|
|
@@ -7733,10 +8041,11 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
|
|
|
lcd_set_cursor(0, 3); lcd_print(">");
|
|
|
lcd_set_cursor(1, 3); lcd_puts_P(_T(MSG_SELFTEST_FAN_NO));
|
|
|
|
|
|
- int8_t enc_dif = 0;
|
|
|
+ int8_t enc_dif = int(_default)*3;
|
|
|
+
|
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
|
|
|
- lcd_button_pressed = false;
|
|
|
+ lcd_button_pressed = false;
|
|
|
do
|
|
|
{
|
|
|
switch (_fan)
|
|
@@ -7756,7 +8065,6 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
|
|
|
#endif //FAN_SOFT_PWM
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
if (abs((enc_dif - lcd_encoder_diff)) > 2) {
|
|
|
if (enc_dif > lcd_encoder_diff) {
|
|
|
_result = !check_opposite;
|
|
@@ -7795,14 +8103,11 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
|
|
|
manage_heater();
|
|
|
|
|
|
return _result;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
#ifdef FANCHECK
|
|
|
-static bool lcd_selftest_fan_dialog(int _fan)
|
|
|
+static FanCheck lcd_selftest_fan_auto(int _fan)
|
|
|
{
|
|
|
- bool _result = true;
|
|
|
- int _errno = 7;
|
|
|
switch (_fan) {
|
|
|
case 0:
|
|
|
fanSpeed = 0;
|
|
@@ -7815,23 +8120,26 @@ static bool lcd_selftest_fan_dialog(int _fan)
|
|
|
_delay(2000); //delay_keep_alive would turn off extruder fan, because temerature is too low
|
|
|
|
|
|
manage_heater(); //count average fan speed from 2s delay and turn off fans
|
|
|
- if (!fan_speed[0]) _result = false;
|
|
|
|
|
|
-
|
|
|
printf_P(PSTR("Test 1:\n"));
|
|
|
printf_P(PSTR("Print fan speed: %d \n"), fan_speed[1]);
|
|
|
printf_P(PSTR("Extr fan speed: %d \n"), fan_speed[0]);
|
|
|
- //SERIAL_ECHOPGM("Extruder fan speed: ");
|
|
|
- //MYSERIAL.println(fan_speed[0]);
|
|
|
- //SERIAL_ECHOPGM("Print fan speed: ");
|
|
|
- //MYSERIAL.print(fan_speed[1]);
|
|
|
+
|
|
|
+ if (!fan_speed[0]) {
|
|
|
+ return FanCheck::ExtruderFan;
|
|
|
+ }
|
|
|
+#ifdef FAN_SOFT_PWM
|
|
|
+ else if (fan_speed[0] > 50 ) { // printerFan is faster
|
|
|
+ return FanCheck::SwappedFan;
|
|
|
+ }
|
|
|
break;
|
|
|
+#endif
|
|
|
|
|
|
case 1:
|
|
|
//will it work with Thotend > 50 C ?
|
|
|
-#ifdef FAN_SOFT_PWM
|
|
|
- fanSpeed = 255;
|
|
|
- fanSpeedSoftPwm = 255;
|
|
|
+#ifdef FAN_SOFT_PWM
|
|
|
+ fanSpeed = 255;
|
|
|
+ fanSpeedSoftPwm = 255;
|
|
|
extruder_autofan_last_check = _millis(); //store time when measurement starts
|
|
|
fan_measuring = true; //start fan measuring, rest is on manage_heater
|
|
|
#else //FAN_SOFT_PWM
|
|
@@ -7845,11 +8153,11 @@ static bool lcd_selftest_fan_dialog(int _fan)
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print("|");
|
|
|
}
|
|
|
-#ifdef FAN_SOFT_PWM
|
|
|
fanSpeed = 0;
|
|
|
- fanSpeedSoftPwm = 0;
|
|
|
+
|
|
|
+#ifdef FAN_SOFT_PWM
|
|
|
+ fanSpeedSoftPwm = 0;
|
|
|
#else //FAN_SOFT_PWM
|
|
|
- fanSpeed = 0;
|
|
|
manage_heater(); //turn off fan
|
|
|
manage_inactivity(true); //to turn off print fan
|
|
|
#endif //FAN_SOFT_PWM
|
|
@@ -7857,40 +8165,42 @@ static bool lcd_selftest_fan_dialog(int _fan)
|
|
|
printf_P(PSTR("Print fan speed: %d \n"), fan_speed[1]);
|
|
|
printf_P(PSTR("Extr fan speed: %d \n"), fan_speed[0]);
|
|
|
if (!fan_speed[1]) {
|
|
|
- _result = false; _errno = 6; //print fan not spinning
|
|
|
+ return FanCheck::PrintFan;
|
|
|
}
|
|
|
-#ifdef FAN_SOFT_PWM
|
|
|
- else {
|
|
|
-#else //FAN_SOFT_PWM
|
|
|
- else if (fan_speed[1] < 34) { //fan is spinning, but measured RPM are too low for print fan, it must be left extruder fan
|
|
|
-#endif //FAN_SOFT_PWM
|
|
|
- //check fans manually
|
|
|
- _result = lcd_selftest_manual_fan_check(1, true); //turn on print fan and check that left extruder fan is not spinning
|
|
|
- if (_result) {
|
|
|
- _result = lcd_selftest_manual_fan_check(1, false); //print fan is stil turned on; check that it is spinning
|
|
|
- if (!_result) _errno = 6; //print fan not spinning
|
|
|
- }
|
|
|
- else {
|
|
|
- _errno = 10; //swapped fans
|
|
|
- }
|
|
|
+
|
|
|
+#ifdef FAN_SOFT_PWM
|
|
|
+ fanSpeed = 80;
|
|
|
+ fanSpeedSoftPwm = 80;
|
|
|
+
|
|
|
+ for (uint8_t i = 0; i < 5; i++) {
|
|
|
+ delay_keep_alive(1000);
|
|
|
+ lcd_set_cursor(18, 3);
|
|
|
+ lcd_print("-");
|
|
|
+ delay_keep_alive(1000);
|
|
|
+ lcd_set_cursor(18, 3);
|
|
|
+ lcd_print("|");
|
|
|
}
|
|
|
+ fanSpeed = 0;
|
|
|
|
|
|
- //SERIAL_ECHOPGM("Extruder fan speed: ");
|
|
|
- //MYSERIAL.println(fan_speed[0]);
|
|
|
- //SERIAL_ECHOPGM("Print fan speed: ");
|
|
|
- //MYSERIAL.println(fan_speed[1]);
|
|
|
+ // noctua speed is between 17 and 24, turbine more then 30
|
|
|
+ if (fan_speed[1] < 30) {
|
|
|
+ return FanCheck::SwappedFan;
|
|
|
+ }
|
|
|
+#else
|
|
|
+ // fan is spinning, but measured RPM are too low for print fan, it must
|
|
|
+ // be left extruder fan
|
|
|
+ else if (fan_speed[1] < 34) {
|
|
|
+ return FanCheck::SwappedFan;
|
|
|
+ }
|
|
|
+#endif //FAN_SOFT_PWM
|
|
|
break;
|
|
|
}
|
|
|
- if (!_result)
|
|
|
- {
|
|
|
- lcd_selftest_error(_errno, NULL, NULL);
|
|
|
- }
|
|
|
- return _result;
|
|
|
+ return FanCheck::Success;
|
|
|
}
|
|
|
|
|
|
#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);
|
|
@@ -7902,57 +8212,58 @@ static int lcd_selftest_screen(testScreen screen, int _progress, int _progress_s
|
|
|
|
|
|
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 r=0
|
|
|
- if (screen == testScreen::axisX) lcd_puts_P(_i("Checking X axis "));////MSG_SELFTEST_CHECK_X c=20 r=0
|
|
|
- if (screen == testScreen::axisY) lcd_puts_P(_i("Checking Y axis "));////MSG_SELFTEST_CHECK_Y c=20 r=0
|
|
|
- if (screen == testScreen::axisZ) lcd_puts_P(_i("Checking Z axis "));////MSG_SELFTEST_CHECK_Z c=20 r=0
|
|
|
- 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 r=0
|
|
|
- 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 r=0
|
|
|
- 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_puts_P(separator);
|
|
|
- if ((screen >= testScreen::extruderFan) && (screen <= testScreen::fansOk))
|
|
|
+ if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk))
|
|
|
{
|
|
|
//SERIAL_ECHOLNPGM("Fan test");
|
|
|
- lcd_puts_at_P(0, 2, _i("Extruder fan:"));////MSG_SELFTEST_EXTRUDER_FAN_SPEED c=18 r=0
|
|
|
+ lcd_puts_at_P(0, 2, _i("Extruder fan:"));////MSG_SELFTEST_EXTRUDER_FAN_SPEED c=18
|
|
|
lcd_set_cursor(18, 2);
|
|
|
- (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 r=0
|
|
|
+ (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_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, _i("Filament sensor:"));////MSG_SELFTEST_FILAMENT_SENSOR c=18 r=0
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
+ lcd_putc(':');
|
|
|
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");
|
|
|
|
|
|
- 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);
|
|
|
|
|
|
- _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);
|
|
|
|
|
|
- _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);
|
|
|
|
|
|
- _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);
|
|
|
|
|
|
- _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);
|
|
|
}
|
|
|
|
|
@@ -8029,8 +8340,8 @@ static void menu_action_sdfile(const char* filename)
|
|
|
const char end[5] = ".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++) {
|
|
|
- if (strcmp((cmd + i + 4), end) == 0) {
|
|
|
+ for (uint_least8_t i = 0; i < 8; i++) {
|
|
|
+ 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
|
|
|
eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, '\0');
|
|
|
break;
|
|
@@ -8043,8 +8354,8 @@ static void menu_action_sdfile(const char* filename)
|
|
|
uint8_t depth = (uint8_t)card.getWorkDirDepth();
|
|
|
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]);
|
|
|
}
|
|
|
}
|
|
@@ -8197,13 +8508,19 @@ void lcd_setstatus(const char* message)
|
|
|
strncpy(lcd_status_message, message, LCD_WIDTH);
|
|
|
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)
|
|
|
{
|
|
|
if (lcd_status_message_level > 0)
|
|
|
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)
|
|
|
{
|
|
@@ -8276,7 +8593,7 @@ void menu_lcd_lcdupdate_func(void)
|
|
|
if(menu_menu==lcd_sdcard_menu)
|
|
|
menu_back();
|
|
|
card.release();
|
|
|
- LCD_MESSAGERPGM(_i("Card removed"));////MSG_SD_REMOVED c=0 r=0
|
|
|
+ LCD_MESSAGERPGM(_i("Card removed"));////MSG_SD_REMOVED
|
|
|
}
|
|
|
}
|
|
|
#endif//CARDINSERTED
|
|
@@ -8287,6 +8604,7 @@ void menu_lcd_lcdupdate_func(void)
|
|
|
if (lcd_draw_update == 0)
|
|
|
lcd_draw_update = 1;
|
|
|
lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
lcd_encoder_diff = 0;
|
|
|
lcd_timeoutToStatus.start();
|
|
|
}
|
|
@@ -8317,5 +8635,5 @@ void menu_lcd_lcdupdate_func(void)
|
|
|
if (!SdFatUtil::test_stack_integrity()) stack_error();
|
|
|
lcd_ping(); //check that we have received ping command if we are in farm mode
|
|
|
lcd_send_status();
|
|
|
- if (lcd_commands_type == LCD_COMMAND_V2_CAL) lcd_commands();
|
|
|
+ if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands();
|
|
|
}
|