|
@@ -114,6 +114,11 @@ union MenuData
|
|
|
|
|
|
char dummy;
|
|
|
} autoLoadFilamentMenu;
|
|
|
+ struct _Lcd_moveMenu
|
|
|
+ {
|
|
|
+ bool initialized;
|
|
|
+ bool endstopsEnabledPrevious;
|
|
|
+ } _lcd_moveMenu;
|
|
|
};
|
|
|
|
|
|
|
|
@@ -192,6 +197,8 @@ unsigned char firstrun = 1;
|
|
|
|
|
|
#include "ultralcd_implementation_hitachi_HD44780.h"
|
|
|
|
|
|
+static const char separator[] PROGMEM = "--------------------";
|
|
|
+
|
|
|
|
|
|
|
|
|
static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg, uint8_t &nlines);
|
|
@@ -222,6 +229,9 @@ static void prusa_stat_temperatures();
|
|
|
static void prusa_stat_printinfo();
|
|
|
static void lcd_farm_no();
|
|
|
static void lcd_menu_extruder_info();
|
|
|
+static void lcd_menu_xyz_y_min();
|
|
|
+static void lcd_menu_xyz_skew();
|
|
|
+static void lcd_menu_xyz_offset();
|
|
|
#if defined(TMC2130) || defined(PAT9125)
|
|
|
static void lcd_menu_fails_stats();
|
|
|
#endif
|
|
@@ -984,7 +994,6 @@ void lcd_commands()
|
|
|
enquecommand_P(PSTR("M190 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP)));
|
|
|
enquecommand_P(PSTR("M109 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP)));
|
|
|
enquecommand_P(MSG_M117_V2_CALIBRATION);
|
|
|
- enquecommand_P(PSTR("G87"));
|
|
|
enquecommand_P(PSTR("G28"));
|
|
|
enquecommand_P(PSTR("G92 E0.0"));
|
|
|
lcd_commands_step = 8;
|
|
@@ -1581,8 +1590,7 @@ static void lcd_menu_extruder_info()
|
|
|
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
- lcd_quick_feedback();
|
|
|
- lcd_return_to_status();
|
|
|
+ menu_action_back();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1686,7 +1694,7 @@ static void lcd_menu_debug()
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
lcd_quick_feedback();
|
|
|
- lcd_return_to_status();
|
|
|
+ menu_action_back();
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
@@ -1702,8 +1710,7 @@ static void lcd_menu_temperatures()
|
|
|
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
- lcd_quick_feedback();
|
|
|
- lcd_return_to_status();
|
|
|
+ menu_action_back();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1720,8 +1727,7 @@ static void lcd_menu_voltages()
|
|
|
fprintf_P(lcdout, PSTR( ESC_H(1,1)"PWR: %d.%01dV"), (int)volt_pwr, (int)(10*fabs(volt_pwr - (int)volt_pwr))) ;
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
- lcd_quick_feedback();
|
|
|
- lcd_return_to_status();
|
|
|
+ menu_action_back();
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
@@ -1732,8 +1738,7 @@ static void lcd_menu_belt_status()
|
|
|
fprintf_P(lcdout, PSTR(ESC_H(1,0) "Belt status" ESC_H(2,1) "X %d" ESC_H(2,2) "Y %d" ), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)));
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
- lcd_quick_feedback();
|
|
|
- lcd_return_to_status();
|
|
|
+ menu_action_back();
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
@@ -1831,7 +1836,7 @@ static void lcd_support_menu()
|
|
|
}
|
|
|
#ifndef MK1BP
|
|
|
MENU_ITEM(back, PSTR("------------"), 0);
|
|
|
- if (!IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL)) MENU_ITEM(function, MSG_XYZ_DETAILS, lcd_service_mode_show_result);
|
|
|
+ MENU_ITEM(submenu, MSG_XYZ_DETAILS, lcd_menu_xyz_y_min);
|
|
|
MENU_ITEM(submenu, MSG_INFO_EXTRUDER, lcd_menu_extruder_info);
|
|
|
|
|
|
#ifdef TMC2130
|
|
@@ -2157,7 +2162,7 @@ void lcd_menu_statistics()
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
lcd_quick_feedback();
|
|
|
- lcd_return_to_status();
|
|
|
+ menu_action_back();
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -2230,12 +2235,18 @@ void lcd_menu_statistics()
|
|
|
KEEPALIVE_STATE(NOT_BUSY);
|
|
|
|
|
|
lcd_quick_feedback();
|
|
|
- lcd_return_to_status();
|
|
|
+ menu_action_back();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
static void _lcd_move(const char *name, int axis, int min, int max) {
|
|
|
+ if (!menuData._lcd_moveMenu.initialized)
|
|
|
+ {
|
|
|
+ menuData._lcd_moveMenu.endstopsEnabledPrevious = enable_endstops(false);
|
|
|
+ menuData._lcd_moveMenu.initialized = true;
|
|
|
+ }
|
|
|
+
|
|
|
if (encoderPosition != 0) {
|
|
|
refresh_cmd_timeout();
|
|
|
if (! planner_queue_full()) {
|
|
@@ -2249,8 +2260,8 @@ static void _lcd_move(const char *name, int axis, int min, int max) {
|
|
|
}
|
|
|
}
|
|
|
if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
|
|
|
- if (LCD_CLICKED) menu_action_back(); {
|
|
|
- }
|
|
|
+ if (menuExiting || LCD_CLICKED) (void)enable_endstops(menuData._lcd_moveMenu.endstopsEnabledPrevious);
|
|
|
+ if (LCD_CLICKED) menu_action_back();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2284,63 +2295,92 @@ static void lcd_move_e()
|
|
|
lcd_return_to_status();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ * @brief Show measured Y distance of front calibration points from Y_MIN_POS
|
|
|
+ *
|
|
|
+ * If those points are detected too close to edge of reachable area, their confidence is lowered.
|
|
|
+ * This functionality is applied more often for MK2 printers.
|
|
|
+ */
|
|
|
+static void lcd_menu_xyz_y_min()
|
|
|
+{
|
|
|
+ lcd.setCursor(0,0);
|
|
|
+ lcd_printPGM(MSG_Y_DISTANCE_FROM_MIN);
|
|
|
+ lcd_print_at_PGM(0, 1, separator);
|
|
|
+ lcd_print_at_PGM(0, 2, MSG_LEFT);
|
|
|
+ lcd_print_at_PGM(0, 3, MSG_RIGHT);
|
|
|
+
|
|
|
+ float distanceMin[2];
|
|
|
+ count_xyz_details(distanceMin);
|
|
|
+
|
|
|
+ for (int i = 0; i < 2; i++) {
|
|
|
+ if(distanceMin[i] < 200) {
|
|
|
+ lcd_print_at_PGM(11, i + 2, PSTR(""));
|
|
|
+ lcd.print(distanceMin[i]);
|
|
|
+ lcd_print_at_PGM((distanceMin[i] < 0) ? 17 : 16, i + 2, PSTR("mm"));
|
|
|
+ } else lcd_print_at_PGM(11, i + 2, PSTR("N/A"));
|
|
|
+ }
|
|
|
+ if (lcd_clicked())
|
|
|
+ {
|
|
|
+ lcd_goto_menu(lcd_menu_xyz_skew);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+ * @brief Show measured axis skewness
|
|
|
+ */
|
|
|
+static void lcd_menu_xyz_skew()
|
|
|
+{
|
|
|
+ float angleDiff;
|
|
|
+ angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW));
|
|
|
|
|
|
-void lcd_service_mode_show_result() {
|
|
|
- float angleDiff;
|
|
|
- lcd_set_custom_characters_degree();
|
|
|
- count_xyz_details();
|
|
|
- angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW));
|
|
|
- lcd_update_enable(false);
|
|
|
- lcd_implementation_clear();
|
|
|
- lcd_printPGM(MSG_Y_DISTANCE_FROM_MIN);
|
|
|
- lcd_print_at_PGM(0, 1, MSG_LEFT);
|
|
|
- lcd_print_at_PGM(0, 2, MSG_RIGHT);
|
|
|
-
|
|
|
- for (int i = 0; i < 2; i++) {
|
|
|
- if(distance_from_min[i] < 200) {
|
|
|
- lcd_print_at_PGM(11, i + 1, PSTR(""));
|
|
|
- lcd.print(distance_from_min[i]);
|
|
|
- lcd_print_at_PGM((distance_from_min[i] < 0) ? 17 : 16, i + 1, PSTR("mm"));
|
|
|
- } else lcd_print_at_PGM(11, i + 1, PSTR("N/A"));
|
|
|
- }
|
|
|
- delay_keep_alive(500);
|
|
|
- KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
- while (!lcd_clicked()) {
|
|
|
- delay_keep_alive(100);
|
|
|
- }
|
|
|
- delay_keep_alive(500);
|
|
|
- lcd_implementation_clear();
|
|
|
-
|
|
|
+ lcd.setCursor(0,0);
|
|
|
+ lcd_printPGM(MSG_MEASURED_SKEW);
|
|
|
+ if (angleDiff < 100) {
|
|
|
+ lcd.setCursor(15, 0);
|
|
|
+ lcd.print(angleDiff * 180 / M_PI);
|
|
|
+ lcd.print(LCD_STR_DEGREE);
|
|
|
+ }else lcd_print_at_PGM(16, 0, PSTR("N/A"));
|
|
|
+ lcd_print_at_PGM(0, 1, separator);
|
|
|
+ lcd_print_at_PGM(0, 2, MSG_SLIGHT_SKEW);
|
|
|
+ lcd_print_at_PGM(15, 2, PSTR(""));
|
|
|
+ lcd.print(bed_skew_angle_mild * 180 / M_PI);
|
|
|
+ lcd.print(LCD_STR_DEGREE);
|
|
|
+ lcd_print_at_PGM(0, 3, MSG_SEVERE_SKEW);
|
|
|
+ lcd_print_at_PGM(15, 3, PSTR(""));
|
|
|
+ lcd.print(bed_skew_angle_extreme * 180 / M_PI);
|
|
|
+ lcd.print(LCD_STR_DEGREE);
|
|
|
|
|
|
- lcd_printPGM(MSG_MEASURED_SKEW);
|
|
|
- if (angleDiff < 100) {
|
|
|
- lcd.setCursor(15, 0);
|
|
|
- lcd.print(angleDiff * 180 / M_PI);
|
|
|
- lcd.print(LCD_STR_DEGREE);
|
|
|
- }else lcd_print_at_PGM(16, 0, PSTR("N/A"));
|
|
|
- lcd_print_at_PGM(0, 1, PSTR("--------------------"));
|
|
|
- lcd_print_at_PGM(0, 2, MSG_SLIGHT_SKEW);
|
|
|
- lcd_print_at_PGM(15, 2, PSTR(""));
|
|
|
- lcd.print(bed_skew_angle_mild * 180 / M_PI);
|
|
|
- lcd.print(LCD_STR_DEGREE);
|
|
|
- lcd_print_at_PGM(0, 3, MSG_SEVERE_SKEW);
|
|
|
- lcd_print_at_PGM(15, 3, PSTR(""));
|
|
|
- lcd.print(bed_skew_angle_extreme * 180 / M_PI);
|
|
|
- lcd.print(LCD_STR_DEGREE);
|
|
|
- delay_keep_alive(500);
|
|
|
- while (!lcd_clicked()) {
|
|
|
- delay_keep_alive(100);
|
|
|
- }
|
|
|
- KEEPALIVE_STATE(NOT_BUSY);
|
|
|
- delay_keep_alive(500);
|
|
|
- lcd_set_custom_characters_arrows();
|
|
|
- lcd_return_to_status();
|
|
|
- lcd_update_enable(true);
|
|
|
- lcd_update(2);
|
|
|
+ if (lcd_clicked())
|
|
|
+ {
|
|
|
+ lcd_goto_menu(lcd_menu_xyz_offset);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ * @brief Show measured bed offset from expected position
|
|
|
+ */
|
|
|
+static void lcd_menu_xyz_offset()
|
|
|
+{
|
|
|
+ lcd.setCursor(0,0);
|
|
|
+ lcd_printPGM(MSG_MEASURED_OFFSET);
|
|
|
+ lcd_print_at_PGM(0, 1, separator);
|
|
|
+ lcd_print_at_PGM(0, 2, PSTR("X"));
|
|
|
+ lcd_print_at_PGM(0, 3, PSTR("Y"));
|
|
|
|
|
|
+ float vec_x[2];
|
|
|
+ float vec_y[2];
|
|
|
+ float cntr[2];
|
|
|
+ world2machine_read_valid(vec_x, vec_y, cntr);
|
|
|
|
|
|
-
|
|
|
+ for (int i = 0; i < 2; i++)
|
|
|
+ {
|
|
|
+ lcd_print_at_PGM(11, i + 2, PSTR(""));
|
|
|
+ lcd.print(cntr[i]);
|
|
|
+ lcd_print_at_PGM((cntr[i] < 0) ? 17 : 16, i + 2, PSTR("mm"));
|
|
|
+ }
|
|
|
+ if (lcd_clicked())
|
|
|
+ {
|
|
|
+ menu_action_back();
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
|
|
|
void EEPROM_save_B(int pos, int* value)
|
|
@@ -2373,7 +2413,17 @@ static void lcd_move_z() {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ * @brief Adjust first layer offset from bed if axis is Z_AXIS
|
|
|
+ *
|
|
|
+ * If menu is left (button pushed or timed out), value is stored to EEPROM and
|
|
|
+ * if the axis is Z_AXIS, CALIBRATION_STATUS_CALIBRATED is also stored.
|
|
|
+ * Purpose of this function for other axis then Z is unknown.
|
|
|
+ *
|
|
|
+ * @param axis AxisEnum X_AXIS Y_AXIS Z_AXIS
|
|
|
+ * other value leads to storing Z_AXIS
|
|
|
+ * @param msg text to be displayed
|
|
|
+ */
|
|
|
static void _lcd_babystep(int axis, const char *msg)
|
|
|
{
|
|
|
if (menuData.babyStep.status == 0) {
|
|
@@ -2420,8 +2470,10 @@ static void _lcd_babystep(int axis, const char *msg)
|
|
|
if (LCD_CLICKED || menuExiting) {
|
|
|
|
|
|
EEPROM_save_B(
|
|
|
- (axis == 0) ? EEPROM_BABYSTEP_X : ((axis == 1) ? EEPROM_BABYSTEP_Y : EEPROM_BABYSTEP_Z),
|
|
|
+ (axis == X_AXIS) ? EEPROM_BABYSTEP_X : ((axis == Y_AXIS) ? EEPROM_BABYSTEP_Y : EEPROM_BABYSTEP_Z),
|
|
|
&menuData.babyStep.babystepMem[axis]);
|
|
|
+
|
|
|
+ if(Z_AXIS == axis) calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
|
|
|
}
|
|
|
if (LCD_CLICKED) menu_action_back();
|
|
|
}
|
|
@@ -3156,7 +3208,7 @@ static void lcd_show_end_stops() {
|
|
|
|
|
|
static void menu_show_end_stops() {
|
|
|
lcd_show_end_stops();
|
|
|
- if (LCD_CLICKED) lcd_goto_menu(lcd_calibration_menu);
|
|
|
+ if (LCD_CLICKED) menu_action_back();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -3644,7 +3696,7 @@ static void lcd_crash_mode_set()
|
|
|
|
|
|
}
|
|
|
#endif
|
|
|
-
|
|
|
+
|
|
|
|
|
|
static void lcd_set_lang(unsigned char lang) {
|
|
|
lang_selected = lang;
|
|
@@ -4009,8 +4061,6 @@ void lcd_wizard(int state) {
|
|
|
case 10:
|
|
|
wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(MSG_WIZARD_REPEAT_V2_CAL, false);
|
|
|
if (wizard_event) {
|
|
|
-
|
|
|
- calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
|
|
|
lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_CLEAN_HEATBED);
|
|
|
state = 9;
|
|
|
}
|
|
@@ -4133,15 +4183,18 @@ static void lcd_settings_menu()
|
|
|
}
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
-
|
|
|
- if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set);
|
|
|
- else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set);
|
|
|
- if (SilentModeMenu == SILENT_MODE_NORMAL)
|
|
|
+ if(!farm_mode)
|
|
|
{
|
|
|
- if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set);
|
|
|
- else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set);
|
|
|
+
|
|
|
+ if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set);
|
|
|
+ else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set);
|
|
|
+ if (SilentModeMenu == SILENT_MODE_NORMAL)
|
|
|
+ {
|
|
|
+ if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set);
|
|
|
+ else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set);
|
|
|
+ }
|
|
|
+ else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info);
|
|
|
}
|
|
|
- else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info);
|
|
|
MENU_ITEM_EDIT(wfac, MSG_EXTRUDER_CORRECTION, &tmc2130_wave_fac[E_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);
|
|
|
#endif
|
|
|
|
|
@@ -5859,16 +5912,19 @@ static void lcd_tune_menu()
|
|
|
#endif
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
+ if(!farm_mode)
|
|
|
+ {
|
|
|
|
|
|
- if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set);
|
|
|
- else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set);
|
|
|
-
|
|
|
- if (SilentModeMenu == SILENT_MODE_NORMAL)
|
|
|
- {
|
|
|
- if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set);
|
|
|
- else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set);
|
|
|
- }
|
|
|
- else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info);
|
|
|
+ if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set);
|
|
|
+ else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set);
|
|
|
+
|
|
|
+ if (SilentModeMenu == SILENT_MODE_NORMAL)
|
|
|
+ {
|
|
|
+ if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set);
|
|
|
+ else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set);
|
|
|
+ }
|
|
|
+ else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info);
|
|
|
+ }
|
|
|
#else
|
|
|
if (!farm_mode) {
|
|
|
switch (SilentModeMenu) {
|
|
@@ -7147,7 +7203,7 @@ static int lcd_selftest_screen(int _step, int _progress, int _progress_scale, bo
|
|
|
if (_step == 13) lcd_printPGM(PSTR("Calibrating home"));
|
|
|
|
|
|
lcd.setCursor(0, 1);
|
|
|
- lcd.print("--------------------");
|
|
|
+ lcd_printPGM(separator);
|
|
|
if ((_step >= -1) && (_step <= 1))
|
|
|
{
|
|
|
|