From a2e3226597ee5fea26ad456d0287eeb223d78d86 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 2 Dec 2018 18:06:20 -0600 Subject: [PATCH] Init XYZ to configured home position --- Marlin/src/Marlin.cpp | 4 +--- Marlin/src/module/motion.cpp | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 3e29f9ad55..a848265c12 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -921,9 +921,7 @@ void setup() { #if HAS_M206_COMMAND // Initialize current position based on home_offset - COPY(current_position, home_offset); - #else - ZERO(current_position); + LOOP_XYZ(a) current_position[a] += home_offset[a]; #endif // Vital to init stepper/planner equivalent for current_position diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index b418f29884..60a86c7d8d 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -88,7 +88,7 @@ bool relative_mode; // = false; * Used by 'buffer_line_to_current_position' to do a move after changing it. * Used by 'sync_plan_position' to update 'planner.position'. */ -float current_position[XYZE] = { 0 }; +float current_position[XYZE] = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS }; /** * Cartesian Destination @@ -96,7 +96,7 @@ float current_position[XYZE] = { 0 }; * and expected by functions like 'prepare_move_to_destination'. * Set with 'get_destination_from_command' or 'set_destination_from_current'. */ -float destination[XYZE] = { 0 }; +float destination[XYZE]; // = { 0 } // The active extruder (tool). Set with T command. #if EXTRUDERS > 1