From 06c6cc119bdb9b0e2d53605d12a8fdd18b3b5b86 Mon Sep 17 00:00:00 2001
From: PavelSindler <sindlerpa@gmail.com>
Date: Tue, 16 Jan 2018 01:00:09 +0100
Subject: [PATCH] xyz homing hotfix, xyz cal. status changed

---
 Firmware/Marlin_main.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp
index a606bbf5..4c5cc7d3 100644
--- a/Firmware/Marlin_main.cpp
+++ b/Firmware/Marlin_main.cpp
@@ -2019,6 +2019,12 @@ bool gcode_M45(bool onlyZ)
 	lcd_display_message_fullscreen_P(MSG_AUTO_HOME);
 	home_xy();
 
+	enable_endstops(false);
+	current_position[X_AXIS] += 5;
+	current_position[Y_AXIS] += 5;
+	plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS] / 40, active_extruder);
+	st_synchronize();
+
 	// Let the user move the Z axes up to the end stoppers.
 #ifdef TMC2130
 	if (calibrate_z_auto())
@@ -2092,7 +2098,7 @@ bool gcode_M45(bool onlyZ)
 			else
 			{
 				// Reset the baby step value and the baby step applied flag.
-				calibration_status_store(CALIBRATION_STATUS_ASSEMBLED);
+				calibration_status_store(CALIBRATION_STATUS_XYZ_CALIBRATION);
 				eeprom_update_word((uint16_t*)EEPROM_BABYSTEP_Z, 0);
 				// Complete XYZ calibration.
 				uint8_t point_too_far_mask = 0;