소스 검색

Update tool_change.cpp (#11559)

InsanityAutomation 6 년 전
부모
커밋
9de730b2bf
1개의 변경된 파일13개의 추가작업 그리고 12개의 파일을 삭제
  1. 13
    12
      Marlin/src/module/tool_change.cpp

+ 13
- 12
Marlin/src/module/tool_change.cpp 파일 보기

354
 void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) {
354
 void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) {
355
   planner.synchronize();
355
   planner.synchronize();
356
 
356
 
357
+  #if HAS_LEVELING
358
+      // Set current position to the physical position
359
+      const bool leveling_was_active = planner.leveling_active;
360
+      set_bed_leveling_enabled(false);
361
+   #endif
362
+  
357
   #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
363
   #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
358
 
364
 
359
     mixing_tool_change(tmp_extruder);
365
     mixing_tool_change(tmp_extruder);
377
           #endif
383
           #endif
378
         }
384
         }
379
 
385
 
380
-        #if HAS_LEVELING
381
-          // Set current position to the physical position
382
-          const bool leveling_was_active = planner.leveling_active;
383
-          set_bed_leveling_enabled(false);
384
-        #endif
385
-
386
         #if ENABLED(DUAL_X_CARRIAGE)
386
         #if ENABLED(DUAL_X_CARRIAGE)
387
 
387
 
388
           #if HAS_SOFTWARE_ENDSTOPS
388
           #if HAS_SOFTWARE_ENDSTOPS
439
           current_position[Z_AXIS] -= zdiff;
439
           current_position[Z_AXIS] -= zdiff;
440
         #endif
440
         #endif
441
 
441
 
442
-        #if HAS_LEVELING
443
-          // Restore leveling to re-establish the logical position
444
-          set_bed_leveling_enabled(leveling_was_active);
445
-        #endif
446
-
447
         // Tell the planner the new "current position"
442
         // Tell the planner the new "current position"
448
         SYNC_PLAN_POSITION_KINEMATIC();
443
         SYNC_PLAN_POSITION_KINEMATIC();
449
 
444
 
516
     #if HAS_FANMUX
511
     #if HAS_FANMUX
517
       fanmux_switch(active_extruder);
512
       fanmux_switch(active_extruder);
518
     #endif
513
     #endif
519
-
514
+  
515
+    #if HAS_LEVELING
516
+          planner.synchronize();
517
+          // Restore leveling to re-establish the logical position
518
+          set_bed_leveling_enabled(leveling_was_active);
519
+    #endif
520
+  
520
     SERIAL_ECHO_START();
521
     SERIAL_ECHO_START();
521
     SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, (int)active_extruder);
522
     SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, (int)active_extruder);
522
 
523
 

Loading…
취소
저장