Browse Source

Tweak M125 code

Scott Lahteine 7 years ago
parent
commit
c6354fa153
1 changed files with 5 additions and 9 deletions
  1. 5
    9
      Marlin/src/gcode/feature/pause/M125.cpp

+ 5
- 9
Marlin/src/gcode/feature/pause/M125.cpp View File

@@ -49,8 +49,6 @@
49 49
  *    Z = override Z raise
50 50
  */
51 51
 void GcodeSuite::M125() {
52
-  point_t park_point = NOZZLE_PARK_POINT;
53
-
54 52
   // Initial retract before move to filament change position
55 53
   const float retract = parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0
56 54
     #ifdef PAUSE_PARK_RETRACT_LENGTH
@@ -58,16 +56,14 @@ void GcodeSuite::M125() {
58 56
     #endif
59 57
   ;
60 58
 
61
-  // Lift Z axis
62
-  if (parser.seenval('Z'))
63
-    park_point.z = parser.linearval('Z');
59
+  point_t park_point = NOZZLE_PARK_POINT;
64 60
 
65 61
   // Move XY axes to filament change position or given position
66
-  if (parser.seenval('X'))
67
-    park_point.x = parser.linearval('X');
62
+  if (parser.seenval('X')) park_point.x = parser.linearval('X');
63
+  if (parser.seenval('Y')) park_point.y = parser.linearval('Y');
68 64
 
69
-  if (parser.seenval('Y'))
70
-    park_point.y = parser.linearval('Y');
65
+  // Lift Z axis
66
+  if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
71 67
 
72 68
   #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE)
73 69
     park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0);

Loading…
Cancel
Save