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
 
921
 
922
   #if HAS_M206_COMMAND
922
   #if HAS_M206_COMMAND
923
     // Initialize current position based on home_offset
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
   #endif
925
   #endif
928
 
926
 
929
   // Vital to init stepper/planner equivalent for current_position
927
   // Vital to init stepper/planner equivalent for current_position

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

88
  *   Used by 'buffer_line_to_current_position' to do a move after changing it.
88
  *   Used by 'buffer_line_to_current_position' to do a move after changing it.
89
  *   Used by 'sync_plan_position' to update 'planner.position'.
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
  * Cartesian Destination
94
  * Cartesian Destination
96
  *   and expected by functions like 'prepare_move_to_destination'.
96
  *   and expected by functions like 'prepare_move_to_destination'.
97
  *   Set with 'get_destination_from_command' or 'set_destination_from_current'.
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
 // The active extruder (tool). Set with T<extruder> command.
101
 // The active extruder (tool). Set with T<extruder> command.
102
 #if EXTRUDERS > 1
102
 #if EXTRUDERS > 1

Loading…
Cancel
Save