|
@@ -202,10 +202,29 @@ enum class TestError : uint_least8_t
|
|
|
|
|
|
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);
|
|
|
+
|
|
|
+ */
|
|
|
+enum class FanCheck : uint_least8_t {
|
|
|
+ success,
|
|
|
+ printFan = TestError::printFan,
|
|
|
+ extruderFan = TestError::extruderFan,
|
|
|
+ swappedFan = TestError::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
|
|
|
+
|
|
|
#ifdef PAT9125
|
|
|
static bool lcd_selftest_fsensor();
|
|
|
#endif
|
|
@@ -800,7 +819,7 @@ void lcdui_print_status_line(void)
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P(PSTR(" "));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Calibration done"));
|
|
|
+ lcd_puts_P(_i("Calibration done"));
|
|
|
custom_message_state--;
|
|
|
}
|
|
|
}
|
|
@@ -1046,8 +1065,11 @@ void lcd_commands()
|
|
|
{
|
|
|
lcd_setstatuspgm(_i("Print paused"));
|
|
|
long_pause();
|
|
|
- lcd_commands_type = 0;
|
|
|
- lcd_commands_step = 0;
|
|
|
+ if (lcd_commands_type == LCD_COMMAND_LONG_PAUSE)
|
|
|
+ {
|
|
|
+ lcd_commands_type = 0;
|
|
|
+ lcd_commands_step = 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1762,6 +1784,7 @@ void lcd_commands()
|
|
|
if (lcd_commands_step == 3 && !blocks_queued()) {
|
|
|
strcpy(cmd1, "M303 E0 S");
|
|
|
strcat(cmd1, ftostr3(pid_temp));
|
|
|
+
|
|
|
enquecommand(cmd1);
|
|
|
lcd_setstatuspgm(_i("PID cal. "));
|
|
|
lcd_commands_step = 2;
|
|
@@ -1770,6 +1793,7 @@ void lcd_commands()
|
|
|
pid_tuning_finished = false;
|
|
|
custom_message_state = 0;
|
|
|
lcd_setstatuspgm(_i("PID cal. finished"));
|
|
|
+ setAllTargetHotends(0);
|
|
|
if (_Kp != 0 || _Ki != 0 || _Kd != 0) {
|
|
|
strcpy(cmd1, "M301 P");
|
|
|
strcat(cmd1, ftostr32(_Kp));
|
|
@@ -2249,9 +2273,9 @@ static void lcd_support_menu()
|
|
|
MENU_ITEM_BACK_P(PSTR("FW - " FW_version));
|
|
|
}*/
|
|
|
|
|
|
- MENU_ITEM_BACK_P(_i("prusa3d.com"));
|
|
|
- MENU_ITEM_BACK_P(_i("forum.prusa3d.com"));
|
|
|
- MENU_ITEM_BACK_P(_i("howto.prusa3d.com"));
|
|
|
+ MENU_ITEM_BACK_P(_i("prusa3d.com"));
|
|
|
+ MENU_ITEM_BACK_P(_i("forum.prusa3d.com"));
|
|
|
+ MENU_ITEM_BACK_P(_i("howto.prusa3d.com"));
|
|
|
MENU_ITEM_BACK_P(STR_SEPARATOR);
|
|
|
MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE));
|
|
|
MENU_ITEM_BACK_P(PSTR(ELECTRONICS));
|
|
@@ -2711,11 +2735,11 @@ void lcd_wait_interact() {
|
|
|
#ifdef SNMM
|
|
|
lcd_puts_P(_i("Prepare new filament"));
|
|
|
#else
|
|
|
- lcd_puts_P(_i("Insert filament"));
|
|
|
+ lcd_puts_P(_i("Insert filament"));
|
|
|
#endif
|
|
|
if (!fsensor_autoload_enabled) {
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("and press the knob"));
|
|
|
+ lcd_puts_P(_i("and press the knob"));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2726,7 +2750,7 @@ void lcd_change_success() {
|
|
|
|
|
|
lcd_set_cursor(0, 2);
|
|
|
|
|
|
- lcd_puts_P(_i("Change success!"));
|
|
|
+ lcd_puts_P(_i("Change success!"));
|
|
|
|
|
|
|
|
|
}
|
|
@@ -2751,7 +2775,7 @@ void lcd_loading_color() {
|
|
|
|
|
|
lcd_set_cursor(0, 0);
|
|
|
|
|
|
- lcd_puts_P(_i("Loading color"));
|
|
|
+ lcd_puts_P(_i("Loading color"));
|
|
|
lcd_set_cursor(0, 2);
|
|
|
lcd_puts_P(_T(MSG_PLEASE_WAIT));
|
|
|
lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL);
|
|
@@ -2803,7 +2827,7 @@ void lcd_alright() {
|
|
|
|
|
|
lcd_set_cursor(0, 0);
|
|
|
|
|
|
- lcd_puts_P(_i("Changed correctly?"));
|
|
|
+ lcd_puts_P(_i("Changed correctly?"));
|
|
|
|
|
|
lcd_set_cursor(1, 1);
|
|
|
|
|
@@ -2811,11 +2835,11 @@ void lcd_alright() {
|
|
|
|
|
|
lcd_set_cursor(1, 2);
|
|
|
|
|
|
- lcd_puts_P(_i("Filament not loaded"));
|
|
|
+ lcd_puts_P(_i("Filament not loaded"));
|
|
|
|
|
|
|
|
|
lcd_set_cursor(1, 3);
|
|
|
- lcd_puts_P(_i("Color not correct"));
|
|
|
+ lcd_puts_P(_i("Color not correct"));
|
|
|
|
|
|
|
|
|
lcd_set_cursor(0, 1);
|
|
@@ -3167,7 +3191,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"));
|
|
|
+ lcd_puts_P(_i("[0;0] point offset"));
|
|
|
lcd_puts_at_P(0, 1, separator);
|
|
|
lcd_puts_at_P(0, 2, PSTR("X"));
|
|
|
lcd_puts_at_P(0, 3, PSTR("Y"));
|
|
@@ -3296,7 +3320,7 @@ static void _lcd_babystep(int axis, const char *msg)
|
|
|
|
|
|
static void lcd_babystep_z()
|
|
|
{
|
|
|
- _lcd_babystep(Z_AXIS, (_i("Adjusting Z")));
|
|
|
+ _lcd_babystep(Z_AXIS, (_i("Adjusting Z")));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -3343,20 +3367,19 @@ void lcd_adjust_bed(void)
|
|
|
}
|
|
|
MENU_BEGIN();
|
|
|
|
|
|
- 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);
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Right side[um]"), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Front side[um]"), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Rear side [um]"), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Reset"), lcd_adjust_bed_reset);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Reset"), lcd_adjust_bed_reset);
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
@@ -3389,7 +3412,7 @@ void lcd_adjust_z() {
|
|
|
|
|
|
lcd_clear();
|
|
|
lcd_set_cursor(0, 0);
|
|
|
- lcd_puts_P(_i("Auto adjust Z?"));
|
|
|
+ lcd_puts_P(_i("Auto adjust Z?"));
|
|
|
lcd_set_cursor(1, 1);
|
|
|
lcd_puts_P(_T(MSG_YES));
|
|
|
|
|
@@ -4336,7 +4359,7 @@ void lcd_pick_babystep(){
|
|
|
|
|
|
lcd_set_cursor(0, 0);
|
|
|
|
|
|
- lcd_puts_P(_i("Pick print"));
|
|
|
+ lcd_puts_P(_i("Pick print"));
|
|
|
|
|
|
|
|
|
lcd_set_cursor(3, 2);
|
|
@@ -4430,10 +4453,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);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Move Y"), lcd_move_y);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Move Z"), lcd_move_z);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Extruder"), lcd_move_e);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Move X"), lcd_move_x);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Move Y"), lcd_move_y);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Move Z"), lcd_move_z);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Extruder"), lcd_move_e);
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
@@ -5157,20 +5180,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
|
|
|
|
|
|
|
|
|
- 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);
|
|
|
- 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);
|
|
|
- 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);
|
|
|
+ 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);
|
|
|
+ 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);
|
|
|
+ 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);
|
|
|
#endif
|
|
|
- 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);
|
|
|
+ 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);
|
|
|
MENU_END();
|
|
|
- if(menu_leaving)
|
|
|
- {
|
|
|
- lcd_settings_linearity_correction_menu_save();
|
|
|
- }
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -5183,7 +5205,7 @@ do\
|
|
|
if (fsensor_not_responding && (mmu_enabled == false))\
|
|
|
{\
|
|
|
\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Fil. sensor [N/A]"), lcd_fsensor_state_set);\
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Fil. sensor [N/A]"), lcd_fsensor_state_set);\
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_fsensor_fail);\
|
|
|
}\
|
|
|
else\
|
|
@@ -5430,11 +5452,11 @@ static void lcd_settings_menu()
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Temperature"), lcd_control_temperature_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Temperature"), lcd_control_temperature_menu);
|
|
|
if (!homing_flag)
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Move axis"), lcd_move_menu_1mm);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Move axis"), lcd_move_menu_1mm);
|
|
|
if (!isPrintPaused)
|
|
|
- MENU_ITEM_GCODE_P(_i("Disable steppers"), PSTR("M84"));
|
|
|
+ MENU_ITEM_GCODE_P(_i("Disable steppers"), PSTR("M84"));
|
|
|
|
|
|
SETTINGS_FILAMENT_SENSOR;
|
|
|
|
|
@@ -5472,7 +5494,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);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);
|
|
|
#endif
|
|
|
|
|
|
SETTINGS_SD;
|
|
@@ -5523,31 +5545,31 @@ static void lcd_calibration_menu()
|
|
|
MENU_ITEM_FUNCTION_P(_i("Wizard"), lcd_wizard);
|
|
|
MENU_ITEM_SUBMENU_P(_i("First layer cal."), lcd_v2_calibration);
|
|
|
MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), PSTR("G28 W"));
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Selftest "), lcd_selftest_v);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Selftest "), lcd_selftest_v);
|
|
|
#ifdef MK1BP
|
|
|
|
|
|
|
|
|
MENU_ITEM_GCODE_P(_T(MSG_HOMEYZ), PSTR("G28 Z"));
|
|
|
#else
|
|
|
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Calibrate XYZ"), lcd_mesh_calibration);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Calibrate XYZ"), lcd_mesh_calibration);
|
|
|
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z);
|
|
|
#ifndef SNMM
|
|
|
|
|
|
#endif
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Mesh Bed Leveling"), lcd_mesh_bedleveling);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Mesh Bed Leveling"), lcd_mesh_bedleveling);
|
|
|
|
|
|
#endif
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Bed level correct"), lcd_adjust_bed);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Bed level correct"), lcd_adjust_bed);
|
|
|
MENU_ITEM_SUBMENU_P(_i("PID calibration"), pid_extruder);
|
|
|
#ifndef TMC2130
|
|
|
MENU_ITEM_SUBMENU_P(_i("Show end stops"), menu_show_end_stops);
|
|
|
#endif
|
|
|
#ifndef MK1BP
|
|
|
- MENU_ITEM_GCODE_P(_i("Reset XYZ calibr."), PSTR("M44"));
|
|
|
+ MENU_ITEM_GCODE_P(_i("Reset XYZ calibr."), PSTR("M44"));
|
|
|
#endif
|
|
|
#ifndef SNMM
|
|
|
|
|
@@ -5917,54 +5939,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);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 1"), extr_adj_0);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 2"), extr_adj_1);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 3"), extr_adj_2);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Load filament 4"), extr_adj_3);
|
|
|
-
|
|
|
- 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);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '1', extr_adj, 0);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '2', extr_adj, 1);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '3', extr_adj, 2);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), '4', extr_adj, 3);
|
|
|
|
|
|
-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, 3);
|
|
|
+ }
|
|
|
+ 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 = e_FILAMENT_ACTION_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);
|
|
@@ -5972,61 +5988,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 = e_FILAMENT_ACTION_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_EJECT_FILAMENT), '1', mmu_cut_filament, 0);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '2', mmu_cut_filament, 1);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '3', mmu_cut_filament, 2);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '4', mmu_cut_filament, 3);
|
|
|
+ MENU_ITEM_FUNCTION_NR_P(_T(MSG_EJECT_FILAMENT), '5', mmu_cut_filament, 4);
|
|
|
+ MENU_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();
|
|
|
+ }
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -6035,14 +6046,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);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 1"), extr_unload_0);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 2"), extr_unload_1);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 3"), extr_unload_2);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 4"), extr_unload_3);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload all"), extr_unload_all);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 1"), extr_unload_0);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 2"), extr_unload_1);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 3"), extr_unload_2);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 4"), extr_unload_3);
|
|
|
|
|
|
if (mmu_enabled)
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Unload filament 5"), extr_unload_4);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Unload filament 5"), extr_unload_4);
|
|
|
|
|
|
MENU_END();
|
|
|
}
|
|
@@ -6433,10 +6444,10 @@ static void lcd_main_menu()
|
|
|
|
|
|
if ( moves_planned() || IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL))
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);
|
|
|
} else
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);
|
|
|
}
|
|
|
|
|
|
#ifdef SDSUPPORT
|
|
@@ -6447,11 +6458,11 @@ static void lcd_main_menu()
|
|
|
if (mesh_bed_leveling_flag == false && homing_flag == false) {
|
|
|
if (card.sdprinting)
|
|
|
{
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Pause print"), lcd_pause_print);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Pause print"), lcd_pause_print);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);
|
|
|
}
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
|
|
|
}
|
|
@@ -6470,16 +6481,16 @@ static void lcd_main_menu()
|
|
|
}
|
|
|
}
|
|
|
#if SDCARDDETECT < 1
|
|
|
- MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21"));
|
|
|
+ MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21"));
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
} else
|
|
|
{
|
|
|
bMain=true;
|
|
|
- MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu);
|
|
|
#if SDCARDDETECT < 1
|
|
|
- MENU_ITEM_GCODE_P(_i("Init. SD card"), PSTR("M21"));
|
|
|
+ MENU_ITEM_GCODE_P(_i("Init. SD card"), PSTR("M21"));
|
|
|
#endif
|
|
|
}
|
|
|
#endif
|
|
@@ -6514,7 +6525,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);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("AutoLoad filament"), lcd_menu_AutoLoadFilament);
|
|
|
else
|
|
|
#endif
|
|
|
{
|
|
@@ -6531,7 +6542,7 @@ static void lcd_main_menu()
|
|
|
|
|
|
if (!is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL))
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);
|
|
|
}
|
|
|
|
|
|
#if defined(TMC2130) || defined(FILAMENT_SENSOR)
|
|
@@ -6540,9 +6551,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);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Support"), lcd_support_menu);
|
|
|
#ifdef LCD_TEST
|
|
|
- MENU_ITEM_SUBMENU_P(_i("W25x20CL init"), lcd_test_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("W25x20CL init"), lcd_test_menu);
|
|
|
#endif
|
|
|
|
|
|
MENU_END();
|
|
@@ -6622,13 +6633,13 @@ static void lcd_tune_menu()
|
|
|
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Speed"), &feedmultiply, 10, 999);
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Speed"), &feedmultiply, 10, 999);
|
|
|
|
|
|
MENU_ITEM_EDIT_int3_P(_T(MSG_NOZZLE), &target_temperature[0], 0, HEATER_0_MAXTEMP - 10);
|
|
|
MENU_ITEM_EDIT_int3_P(_T(MSG_BED), &target_temperature_bed, 0, BED_MAXTEMP - 10);
|
|
|
|
|
|
MENU_ITEM_EDIT_int3_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255);
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Flow"), &extrudemultiply, 10, 999);
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Flow"), &extrudemultiply, 10, 999);
|
|
|
#ifdef FILAMENTCHANGEENABLE
|
|
|
MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);
|
|
|
#endif
|
|
@@ -6723,18 +6734,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);
|
|
|
- else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_toggle);
|
|
|
+ if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_toggle);
|
|
|
+ else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_toggle);
|
|
|
switch (mbl_z_probe_nr) {
|
|
|
- case 1: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [1]"), mbl_probe_nr_toggle); break;
|
|
|
- case 5: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [5]"), mbl_probe_nr_toggle); break;
|
|
|
- default: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [3]"), mbl_probe_nr_toggle); break;
|
|
|
+ case 1: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [1]"), mbl_probe_nr_toggle); break;
|
|
|
+ case 5: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [5]"), mbl_probe_nr_toggle); break;
|
|
|
+ default: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [3]"), mbl_probe_nr_toggle); break;
|
|
|
}
|
|
|
if (points_nr == 7) {
|
|
|
- if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets comp. [On]"), mbl_magnets_elimination_toggle);
|
|
|
- else MENU_ITEM_FUNCTION_P(_i("Magnets comp.[Off]"), mbl_magnets_elimination_toggle);
|
|
|
+ if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets comp. [On]"), mbl_magnets_elimination_toggle);
|
|
|
+ else MENU_ITEM_FUNCTION_P(_i("Magnets comp.[Off]"), mbl_magnets_elimination_toggle);
|
|
|
}
|
|
|
- else menu_item_text_P(_i("Magnets comp.[N/A]"));
|
|
|
+ else menu_item_text_P(_i("Magnets comp.[N/A]"));
|
|
|
MENU_END();
|
|
|
|
|
|
}
|
|
@@ -6753,10 +6764,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);
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Nozzle2"), &target_temperature[1], 0, HEATER_1_MAXTEMP - 10);
|
|
|
#endif
|
|
|
#if TEMP_SENSOR_2 != 0
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Nozzle3"), &target_temperature[2], 0, HEATER_2_MAXTEMP - 10);
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Nozzle3"), &target_temperature[2], 0, HEATER_2_MAXTEMP - 10);
|
|
|
#endif
|
|
|
#if TEMP_SENSOR_BED != 0
|
|
|
MENU_ITEM_EDIT_int3_P(_T(MSG_BED), &target_temperature_bed, 0, BED_MAXTEMP - 3);
|
|
@@ -6765,9 +6776,9 @@ static void lcd_control_temperature_menu()
|
|
|
#if defined AUTOTEMP && (TEMP_SENSOR_0 != 0)
|
|
|
|
|
|
MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
|
|
|
- MENU_ITEM_EDIT(float3, _i(" \002 Min"), &autotemp_min, 0, HEATER_0_MAXTEMP - 10);
|
|
|
- MENU_ITEM_EDIT(float3, _i(" \002 Max"), &autotemp_max, 0, HEATER_0_MAXTEMP - 10);
|
|
|
- MENU_ITEM_EDIT(float32, _i(" \002 Fact"), &autotemp_factor, 0.0, 1.0);
|
|
|
+ MENU_ITEM_EDIT(float3, _i(" \002 Min"), &autotemp_min, 0, HEATER_0_MAXTEMP - 10);
|
|
|
+ MENU_ITEM_EDIT(float3, _i(" \002 Max"), &autotemp_max, 0, HEATER_0_MAXTEMP - 10);
|
|
|
+ MENU_ITEM_EDIT(float32, _i(" \002 Fact"), &autotemp_factor, 0.0, 1.0);
|
|
|
#endif
|
|
|
|
|
|
MENU_END();
|
|
@@ -6917,9 +6928,10 @@ 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 "));
|
|
|
+ lcd_set_cursor(0, 0); lcd_puts_P(_i("Self test start "));
|
|
|
#ifdef TMC2130
|
|
|
FORCE_HIGH_POWER_START;
|
|
|
#endif
|
|
@@ -6928,29 +6940,63 @@ bool lcd_selftest()
|
|
|
|
|
|
_progress = lcd_selftest_screen(testScreen::extruderFan, _progress, 3, true, 2000);
|
|
|
#if (defined(FANCHECK) && defined(TACH_0))
|
|
|
- _result = lcd_selftest_fan_dialog(0);
|
|
|
+ switch (lcd_selftest_fan_auto(0)){
|
|
|
+ case FanCheck::extruderFan:
|
|
|
+ _result = false;
|
|
|
+ break;
|
|
|
+ case FanCheck::swappedFan:
|
|
|
+ _swapped_fan = true;
|
|
|
+
|
|
|
+ default:
|
|
|
+ _result = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
#else
|
|
|
_result = lcd_selftest_manual_fan_check(0, false);
|
|
|
+#endif
|
|
|
if (!_result)
|
|
|
{
|
|
|
lcd_selftest_error(TestError::extruderFan, "", "");
|
|
|
}
|
|
|
-#endif
|
|
|
-
|
|
|
|
|
|
if (_result)
|
|
|
{
|
|
|
_progress = lcd_selftest_screen(testScreen::printFan, _progress, 3, true, 2000);
|
|
|
-#if (defined(FANCHECK) && defined(TACH_1))
|
|
|
- _result = lcd_selftest_fan_dialog(1);
|
|
|
+#if (defined(FANCHECK) && defined(TACH_1))
|
|
|
+ switch (lcd_selftest_fan_auto(1)){
|
|
|
+ case FanCheck::printFan:
|
|
|
+ _result = false;
|
|
|
+ break;
|
|
|
+ case FanCheck::swappedFan:
|
|
|
+ _swapped_fan = true;
|
|
|
+
|
|
|
+ default:
|
|
|
+ _result = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
#else
|
|
|
_result = lcd_selftest_manual_fan_check(1, false);
|
|
|
+#endif
|
|
|
if (!_result)
|
|
|
- {
|
|
|
+ {
|
|
|
lcd_selftest_error(TestError::printFan, "", "");
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
-#endif
|
|
|
+ if (_swapped_fan) {
|
|
|
+
|
|
|
+ _result = lcd_selftest_manual_fan_check(1, true);
|
|
|
+ if (_result) {
|
|
|
+
|
|
|
+ _result = lcd_selftest_manual_fan_check(1, false, true);
|
|
|
+ if (!_result){
|
|
|
+ lcd_selftest_error(TestError::printFan, "", "");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+
|
|
|
+ lcd_selftest_error(TestError::swappedFan, "", "");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (_result)
|
|
@@ -7099,7 +7145,7 @@ bool lcd_selftest()
|
|
|
|
|
|
if (_result)
|
|
|
{
|
|
|
- LCD_ALERTMESSAGERPGM(_i("Self test OK"));
|
|
|
+ LCD_ALERTMESSAGERPGM(_i("Self test OK"));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -7526,27 +7572,27 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
|
|
|
lcd_clear();
|
|
|
|
|
|
lcd_set_cursor(0, 0);
|
|
|
- lcd_puts_P(_i("Selftest error !"));
|
|
|
+ lcd_puts_P(_i("Selftest error !"));
|
|
|
lcd_set_cursor(0, 1);
|
|
|
- lcd_puts_P(_i("Please check :"));
|
|
|
+ lcd_puts_P(_i("Please check :"));
|
|
|
|
|
|
switch (testError)
|
|
|
{
|
|
|
case TestError::heater:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Heater/Thermistor"));
|
|
|
+ lcd_puts_P(_i("Heater/Thermistor"));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Not connected"));
|
|
|
+ lcd_puts_P(_i("Not connected"));
|
|
|
break;
|
|
|
case TestError::bed:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Bed / Heater"));
|
|
|
+ lcd_puts_P(_i("Bed / Heater"));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
break;
|
|
|
case TestError::endstops:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Endstops"));
|
|
|
+ lcd_puts_P(_i("Endstops"));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
lcd_set_cursor(17, 3);
|
|
@@ -7558,7 +7604,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
|
|
|
lcd_set_cursor(18, 2);
|
|
|
lcd_print(_error_1);
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Endstop"));
|
|
|
+ lcd_puts_P(_i("Endstop"));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_2);
|
|
|
break;
|
|
@@ -7596,17 +7642,17 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
|
|
|
break;
|
|
|
case TestError::axis:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Axis length"));
|
|
|
+ lcd_puts_P(_i("Axis length"));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Axis"));
|
|
|
+ lcd_puts_P(_i("Axis"));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
case TestError::swappedFan:
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Front/left fans"));
|
|
|
+ lcd_puts_P(_i("Front/left fans"));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Swapped"));
|
|
|
+ lcd_puts_P(_i("Swapped"));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
@@ -7620,7 +7666,7 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
|
|
|
lcd_set_cursor(0, 2);
|
|
|
lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("False triggering"));
|
|
|
+ lcd_puts_P(_i("False triggering"));
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -7720,19 +7766,20 @@ static bool selftest_irsensor()
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
-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:
|
|
|
|
|
|
- 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);
|
|
@@ -7758,10 +7805,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)
|
|
@@ -7781,7 +7829,6 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
|
|
|
#endif
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
if (abs((enc_dif - lcd_encoder_diff)) > 2) {
|
|
|
if (enc_dif > lcd_encoder_diff) {
|
|
|
_result = !check_opposite;
|
|
@@ -7820,14 +7867,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;
|
|
|
- TestError testError = TestError::extruderFan;
|
|
|
switch (_fan) {
|
|
|
case 0:
|
|
|
fanSpeed = 0;
|
|
@@ -7840,23 +7884,26 @@ static bool lcd_selftest_fan_dialog(int _fan)
|
|
|
_delay(2000);
|
|
|
|
|
|
manage_heater();
|
|
|
- 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]);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ if (!fan_speed[0]) {
|
|
|
+ return FanCheck::extruderFan;
|
|
|
+ }
|
|
|
+#ifdef FAN_SOFT_PWM
|
|
|
+ else if (fan_speed[0] > 50 ) {
|
|
|
+ return FanCheck::swappedFan;
|
|
|
+ }
|
|
|
break;
|
|
|
+#endif
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
-#ifdef FAN_SOFT_PWM
|
|
|
- fanSpeed = 255;
|
|
|
- fanSpeedSoftPwm = 255;
|
|
|
+#ifdef FAN_SOFT_PWM
|
|
|
+ fanSpeed = 255;
|
|
|
+ fanSpeedSoftPwm = 255;
|
|
|
extruder_autofan_last_check = _millis();
|
|
|
fan_measuring = true;
|
|
|
#else
|
|
@@ -7870,11 +7917,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
|
|
|
- fanSpeed = 0;
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
|
#endif
|
|
@@ -7882,35 +7929,37 @@ 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; testError = TestError::printFan;
|
|
|
+ return FanCheck::printFan;
|
|
|
}
|
|
|
-#ifdef FAN_SOFT_PWM
|
|
|
- else {
|
|
|
-#else
|
|
|
- else if (fan_speed[1] < 34) {
|
|
|
-#endif
|
|
|
-
|
|
|
- _result = lcd_selftest_manual_fan_check(1, true);
|
|
|
- if (_result) {
|
|
|
- _result = lcd_selftest_manual_fan_check(1, false);
|
|
|
- if (!_result) testError = TestError::printFan;
|
|
|
- }
|
|
|
- else {
|
|
|
- testError = TestError::swappedFan;
|
|
|
- }
|
|
|
+
|
|
|
+#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;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ if (fan_speed[1] < 30) {
|
|
|
+ return FanCheck::swappedFan;
|
|
|
+ }
|
|
|
+#else
|
|
|
+
|
|
|
+
|
|
|
+ else if (fan_speed[1] < 34) {
|
|
|
+ return FanCheck::swappedFan;
|
|
|
+ }
|
|
|
+#endif
|
|
|
break;
|
|
|
}
|
|
|
- if (!_result)
|
|
|
- {
|
|
|
- lcd_selftest_error(testError, "", "");
|
|
|
- }
|
|
|
- return _result;
|
|
|
+ return FanCheck::success;
|
|
|
}
|
|
|
|
|
|
#endif
|
|
@@ -7930,16 +7979,16 @@ static int lcd_selftest_screen(testScreen screen, int _progress, int _progress_s
|
|
|
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"));
|
|
|
- if (screen == testScreen::axisX) lcd_puts_P(_i("Checking X axis "));
|
|
|
- if (screen == testScreen::axisY) lcd_puts_P(_i("Checking Y axis "));
|
|
|
- if (screen == testScreen::axisZ) lcd_puts_P(_i("Checking Z axis "));
|
|
|
+ if (screen == testScreen::endStops) lcd_puts_P(_i("Checking endstops"));
|
|
|
+ if (screen == testScreen::axisX) lcd_puts_P(_i("Checking X axis "));
|
|
|
+ if (screen == testScreen::axisY) lcd_puts_P(_i("Checking Y axis "));
|
|
|
+ if (screen == testScreen::axisZ) lcd_puts_P(_i("Checking Z axis "));
|
|
|
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 "));
|
|
|
+ || screen == testScreen::hotendOk) lcd_puts_P(_i("Checking hotend "));
|
|
|
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 "));
|
|
|
+ if (screen == testScreen::allCorrect) lcd_puts_P(_i("All correct "));
|
|
|
if (screen == testScreen::failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED));
|
|
|
if (screen == testScreen::home) lcd_puts_P(_i("Calibrating home"));
|
|
|
|
|
@@ -7948,10 +7997,10 @@ static int lcd_selftest_screen(testScreen screen, int _progress, int _progress_s
|
|
|
if ((screen >= testScreen::extruderFan) && (screen <= testScreen::fansOk))
|
|
|
{
|
|
|
|
|
|
- lcd_puts_at_P(0, 2, _i("Extruder fan:"));
|
|
|
+ lcd_puts_at_P(0, 2, _i("Extruder fan:"));
|
|
|
lcd_set_cursor(18, 2);
|
|
|
(screen < testScreen::printFan) ? lcd_print(_indicator) : lcd_print("OK");
|
|
|
- lcd_puts_at_P(0, 3, _i("Print fan:"));
|
|
|
+ lcd_puts_at_P(0, 3, _i("Print fan:"));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
(screen < testScreen::fansOk) ? lcd_print(_indicator) : lcd_print("OK");
|
|
|
}
|
|
@@ -8302,7 +8351,7 @@ void menu_lcd_lcdupdate_func(void)
|
|
|
if(menu_menu==lcd_sdcard_menu)
|
|
|
menu_back();
|
|
|
card.release();
|
|
|
- LCD_MESSAGERPGM(_i("Card removed"));
|
|
|
+ LCD_MESSAGERPGM(_i("Card removed"));
|
|
|
}
|
|
|
}
|
|
|
#endif
|