Direct home instead of G28

This commit is contained in:
vintagepc 2020-02-09 10:13:15 -05:00 committed by VintagePC
parent b75e3b5233
commit b7daac3b70
1 changed files with 12 additions and 1 deletions

View File

@ -241,6 +241,8 @@ static void lcd_sheet_menu();
static void menu_action_sdfile(const char* filename); static void menu_action_sdfile(const char* filename);
static void menu_action_sddirectory(const char* filename); static void menu_action_sddirectory(const char* filename);
static void lcd_rehome_xy();
#define ENCODER_FEEDRATE_DEADZONE 10 #define ENCODER_FEEDRATE_DEADZONE 10
#define STATE_NA 255 #define STATE_NA 255
@ -5335,6 +5337,15 @@ void stepper_timer_overflow() {
} }
#endif /* DEBUG_STEPPER_TIMER_MISSED */ #endif /* DEBUG_STEPPER_TIMER_MISSED */
static void lcd_rehome_xy() {
// Do home directly, G28 X Y resets MBL, which could be bad.
homeaxis(X_AXIS);
homeaxis(Y_AXIS);
lcd_setstatuspgm(_T(MSG_AUTO_HOME));
lcd_return_to_status();
lcd_draw_update = 3;
}
static void lcd_colorprint_change() { static void lcd_colorprint_change() {
@ -5442,7 +5453,7 @@ static void lcd_tune_menu()
MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change); MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);
#endif #endif
if (isPrintPaused) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. if (isPrintPaused) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky.
MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), PSTR("G28 X Y")); MENU_ITEM_FUNCTION_P(_T(MSG_AUTO_HOME), lcd_rehome_xy);
} }
#ifdef FILAMENT_SENSOR #ifdef FILAMENT_SENSOR
MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu);