From 060e7a3565be6a37da887c255111432afb45309b Mon Sep 17 00:00:00 2001 From: silentninja1 Date: Tue, 24 Jul 2018 15:44:50 -0400 Subject: [PATCH] Silentninja1 idex crash fix (#11329) * Move home all axis prototype to allow access from UBL.h * Remove home all axis command as it exists in marlin.h now * Reverse order of tool change and home Race condition causes E0 carriage to move on E1 commands and crash into parked head if order is reversed. Needs more research into permanent fix, but this will prevent damage to machines in the meantime. --- Marlin/Marlin.h | 2 ++ Marlin/ubl.h | 1 - Marlin/ubl_G29.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index d5cae084ea9..27d7e49e5cb 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -301,6 +301,8 @@ extern float soft_endstop_min[XYZ], soft_endstop_max[XYZ]; void tool_change(const uint8_t tmp_extruder, const float fr_mm_s=0.0, bool no_move=false); +void home_all_axes(); + void report_current_position(); #if IS_KINEMATIC diff --git a/Marlin/ubl.h b/Marlin/ubl.h index 873e5e6ec45..03380af4528 100644 --- a/Marlin/ubl.h +++ b/Marlin/ubl.h @@ -54,7 +54,6 @@ enum MeshPointType : char { INVALID, REAL, SET_IN_BITMAP }; // External references char *ftostr43sign(const float&, char); -void home_all_axes(); extern uint8_t ubl_cnt; diff --git a/Marlin/ubl_G29.cpp b/Marlin/ubl_G29.cpp index 0286a768584..2345da715e5 100644 --- a/Marlin/ubl_G29.cpp +++ b/Marlin/ubl_G29.cpp @@ -296,10 +296,10 @@ // Check for commands that require the printer to be homed if (may_move) { - if (axis_unhomed_error()) home_all_axes(); #if ENABLED(DUAL_X_CARRIAGE) if (active_extruder != 0) tool_change(0); #endif + if (axis_unhomed_error()) home_all_axes(); } // Invalidate Mesh Points. This command is a little bit asymmetrical because