Browse Source

Toolchange improvements (#16979)

InsanityAutomation 4 years ago
parent
commit
4250a98908
No account linked to committer's email address
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      Marlin/src/module/tool_change.cpp

+ 5
- 4
Marlin/src/module/tool_change.cpp View File

@@ -45,8 +45,8 @@
45 45
   #endif
46 46
 #endif
47 47
 
48
-#if ENABLED(MAGNETIC_PARKING_EXTRUDER) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0)
49
-  #include "../gcode/gcode.h" // for dwell()
48
+#if ENABLED(MAGNETIC_PARKING_EXTRUDER) || defined(EVENT_GCODE_AFTER_TOOLCHANGE) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0)
49
+  #include "../gcode/gcode.h"
50 50
 #endif
51 51
 
52 52
 #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SWITCHING_TOOLHEAD)
@@ -861,7 +861,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
861 861
       }
862 862
     #endif // TOOLCHANGE_FILAMENT_SWAP
863 863
 
864
-    #if HAS_LEVELING
864
+    #if HAS_LEVELING && DISABLED(SINGLENOZZLE)
865 865
       // Set current position to the physical position
866 866
       TEMPORARY_BED_LEVELING_STATE(false);
867 867
     #endif
@@ -1068,7 +1068,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
1068 1068
     #endif
1069 1069
 
1070 1070
     #ifdef EVENT_GCODE_AFTER_TOOLCHANGE
1071
-      gcode.process_subcommands_now_P(EVENT_GCODE_AFTER_TOOLCHANGE);
1071
+      if (!no_move)
1072
+        gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_AFTER_TOOLCHANGE));
1072 1073
     #endif
1073 1074
 
1074 1075
     SERIAL_ECHO_START();

Loading…
Cancel
Save