Scott Lahteine 7 years ago
parent
commit
a2a30ff0ac

+ 9
- 5
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

292
 
292
 
293
   void unified_bed_leveling::G29() {
293
   void unified_bed_leveling::G29() {
294
 
294
 
295
-    if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem,
295
+    if (g29_parameter_parsing()) return; // Abort on parameter error
296
+
297
+    const int8_t p_val = parser.intval('P', -1);
298
+    const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J');
296
 
299
 
297
     // Check for commands that require the printer to be homed
300
     // Check for commands that require the printer to be homed
298
-    if (axis_unhomed_error()) {
299
-      const int8_t p_val = parser.intval('P', -1);
300
-      if (p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J'))
301
-        gcode.home_all_axes();
301
+    if (may_move) {
302
+      if (axis_unhomed_error()) gcode.home_all_axes();
303
+      #if ENABLED(DUAL_X_CARRIAGE)
304
+        if (active_extruder != 0) tool_change(0);
305
+      #endif
302
     }
306
     }
303
 
307
 
304
     // Invalidate Mesh Points. This command is a little bit asymmetrical because
308
     // Invalidate Mesh Points. This command is a little bit asymmetrical because

+ 4
- 0
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

268
    */
268
    */
269
   if (!g29_in_progress) {
269
   if (!g29_in_progress) {
270
 
270
 
271
+    #if ENABLED(DUAL_X_CARRIAGE)
272
+      if (active_extruder != 0) tool_change(0);
273
+    #endif
274
+
271
     #if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR)
275
     #if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR)
272
       abl_probe_index = -1;
276
       abl_probe_index = -1;
273
     #endif
277
     #endif

Loading…
Cancel
Save