Browse Source

🚸 Restore active tool after ABL G29 (#23692)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
ellensp 3 years ago
parent
commit
0a24f858f3
No account linked to committer's email address

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

316
     planner.synchronize();
316
     planner.synchronize();
317
     // Send 'N' to force homing before G29 (internal only)
317
     // Send 'N' to force homing before G29 (internal only)
318
     if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes();
318
     if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes();
319
-    TERN_(HAS_MULTI_HOTEND, if (active_extruder) tool_change(0));
319
+    TERN_(HAS_MULTI_HOTEND, if (active_extruder != 0) tool_change(0, true));
320
   }
320
   }
321
 
321
 
322
   // Invalidate one or more nearby mesh points, possibly all.
322
   // Invalidate one or more nearby mesh points, possibly all.
663
     UNUSED(probe_deployed);
663
     UNUSED(probe_deployed);
664
   #endif
664
   #endif
665
 
665
 
666
-  TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index));
666
+  TERN_(HAS_MULTI_HOTEND, if (old_tool_index != 0) tool_change(old_tool_index));
667
   return;
667
   return;
668
 }
668
 }
669
 
669
 

+ 1
- 1
Marlin/src/gcode/bedlevel/G35.cpp View File

155
 
155
 
156
   // Restore the active tool after homing
156
   // Restore the active tool after homing
157
   #if HAS_MULTI_HOTEND
157
   #if HAS_MULTI_HOTEND
158
-    tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER)); // Fetch previous toolhead if not PARKING_EXTRUDER
158
+    if (old_tool_index != 0) tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER)); // Fetch previous toolhead if not PARKING_EXTRUDER
159
   #endif
159
   #endif
160
 
160
 
161
   #if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G35)
161
   #if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G35)

+ 10
- 1
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

93
   bool      dryrun,
93
   bool      dryrun,
94
             reenable;
94
             reenable;
95
 
95
 
96
+  #if HAS_MULTI_HOTEND
97
+    uint8_t tool_index;
98
+  #endif
99
+
96
   #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR)
100
   #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR)
97
     int abl_probe_index;
101
     int abl_probe_index;
98
   #endif
102
   #endif
263
    */
267
    */
264
   if (!g29_in_progress) {
268
   if (!g29_in_progress) {
265
 
269
 
266
-    TERN_(HAS_MULTI_HOTEND, if (active_extruder) tool_change(0));
270
+    #if HAS_MULTI_HOTEND
271
+      abl.tool_index = active_extruder;
272
+      if (active_extruder != 0) tool_change(0, true);
273
+    #endif
267
 
274
 
268
     #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR)
275
     #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR)
269
       abl.abl_probe_index = -1;
276
       abl.abl_probe_index = -1;
891
 
898
 
892
   TERN_(HAS_DWIN_E3V2_BASIC, DWIN_CompletedLeveling());
899
   TERN_(HAS_DWIN_E3V2_BASIC, DWIN_CompletedLeveling());
893
 
900
 
901
+  TERN_(HAS_MULTI_HOTEND, if (abl.tool_index != 0) tool_change(abl.tool_index));
902
+
894
   report_current_position();
903
   report_current_position();
895
 
904
 
896
   TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
905
   TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));

Loading…
Cancel
Save