Browse Source

Force T0 in UBL G29 on all multi-hotend setups (#16774)

InsanityAutomation 4 years ago
parent
commit
62d9e3f50e
No account linked to committer's email address
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

+ 8
- 2
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

@@ -38,7 +38,7 @@
38 38
   #include "../../../gcode/gcode.h"
39 39
   #include "../../../libs/least_squares_fit.h"
40 40
 
41
-  #if ENABLED(DUAL_X_CARRIAGE)
41
+  #if HOTENDS > 1
42 42
     #include "../../../module/tool_change.h"
43 43
   #endif
44 44
 
@@ -305,12 +305,15 @@
305 305
 
306 306
     const int8_t p_val = parser.intval('P', -1);
307 307
     const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J');
308
+    #if HOTENDS > 1
309
+      const uint8_t old_tool_index = active_extruder;
310
+    #endif
308 311
 
309 312
     // Check for commands that require the printer to be homed
310 313
     if (may_move) {
311 314
       planner.synchronize();
312 315
       if (axes_need_homing()) gcode.home_all_axes();
313
-      #if ENABLED(DUAL_X_CARRIAGE)
316
+      #if HOTENDS > 1
314 317
         if (active_extruder != 0) tool_change(0);
315 318
       #endif
316 319
     }
@@ -684,6 +687,9 @@
684 687
       UNUSED(probe_deployed);
685 688
     #endif
686 689
 
690
+    #if HOTENDS > 1
691
+      tool_change(old_tool_index);
692
+    #endif
687 693
     return;
688 694
   }
689 695
 

Loading…
Cancel
Save