From 15be1cb9a9e7d2154cd3247ad3530a58753405af Mon Sep 17 00:00:00 2001 From: GMagician <3684609+GMagician@users.noreply.github.com> Date: Tue, 31 Oct 2017 04:50:50 +0100 Subject: [PATCH] [1.1.x] Fix NO_MOTION_BEFORE_HOMING unwanted behaviour (#8177) * [1.1.x] Fix NO_MOTION_BEFORE_HOMING unwanted behaviour NO_MOTION_BEFORE_HOMING should prevent XYZ movements only when homing is not done. E axes should be allowed * Update Marlin_main.cpp * Update Marlin_main.cpp * Update Marlin_main.cpp --- Marlin/Marlin_main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 10b1bdd45..5579f479e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3415,6 +3415,12 @@ void gcode_get_destination() { ***************** GCode Handlers ***************** **************************************************/ +#if ENABLED(NO_MOTION_BEFORE_HOMING) + #define G0_G1_CONDITION !axis_unhomed_error(parser.seen('X'), parser.seen('Y'), parser.seen('Z')) +#else + #define G0_G1_CONDITION true +#endif + /** * G0, G1: Coordinated movement of X Y Z E axes */ @@ -3423,11 +3429,7 @@ inline void gcode_G0_G1( bool fast_move=false #endif ) { - #if ENABLED(NO_MOTION_BEFORE_HOMING) - if (axis_unhomed_error()) return; - #endif - - if (IsRunning()) { + if (IsRunning() && G0_G1_CONDITION) { gcode_get_destination(); // For X Y Z E F #if ENABLED(FWRETRACT)