Browse Source

Init XYZ to configured home position

Scott Lahteine 6 years ago
parent
commit
a2e3226597
2 changed files with 3 additions and 5 deletions
  1. 1
    3
      Marlin/src/Marlin.cpp
  2. 2
    2
      Marlin/src/module/motion.cpp

+ 1
- 3
Marlin/src/Marlin.cpp View File

@@ -921,9 +921,7 @@ void setup() {
921 921
 
922 922
   #if HAS_M206_COMMAND
923 923
     // Initialize current position based on home_offset
924
-    COPY(current_position, home_offset);
925
-  #else
926
-    ZERO(current_position);
924
+    LOOP_XYZ(a) current_position[a] += home_offset[a];
927 925
   #endif
928 926
 
929 927
   // Vital to init stepper/planner equivalent for current_position

+ 2
- 2
Marlin/src/module/motion.cpp View File

@@ -88,7 +88,7 @@ bool relative_mode; // = false;
88 88
  *   Used by 'buffer_line_to_current_position' to do a move after changing it.
89 89
  *   Used by 'sync_plan_position' to update 'planner.position'.
90 90
  */
91
-float current_position[XYZE] = { 0 };
91
+float current_position[XYZE] = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS };
92 92
 
93 93
 /**
94 94
  * Cartesian Destination
@@ -96,7 +96,7 @@ float current_position[XYZE] = { 0 };
96 96
  *   and expected by functions like 'prepare_move_to_destination'.
97 97
  *   Set with 'get_destination_from_command' or 'set_destination_from_current'.
98 98
  */
99
-float destination[XYZE] = { 0 };
99
+float destination[XYZE]; // = { 0 }
100 100
 
101 101
 // The active extruder (tool). Set with T<extruder> command.
102 102
 #if EXTRUDERS > 1

Loading…
Cancel
Save