Browse Source

Separate Dual X un-park from movement

Scott Lahteine 7 years ago
parent
commit
7c1adff8ad
1 changed files with 13 additions and 16 deletions
  1. 13
    16
      Marlin/Marlin_main.cpp

+ 13
- 16
Marlin/Marlin_main.cpp View File

12824
 #if ENABLED(DUAL_X_CARRIAGE)
12824
 #if ENABLED(DUAL_X_CARRIAGE)
12825
 
12825
 
12826
   /**
12826
   /**
12827
-   * Prepare a linear move in a dual X axis setup
12827
+   * Unpark the carriage, if needed
12828
    */
12828
    */
12829
-  inline bool prepare_move_to_destination_dualx() {
12830
-    if (active_extruder_parked) {
12829
+  inline bool dual_x_carriage_unpark() {
12830
+    if (active_extruder_parked)
12831
       switch (dual_x_carriage_mode) {
12831
       switch (dual_x_carriage_mode) {
12832
-        case DXC_FULL_CONTROL_MODE:
12833
-          break;
12832
+
12833
+        case DXC_FULL_CONTROL_MODE: break;
12834
+
12834
         case DXC_AUTO_PARK_MODE:
12835
         case DXC_AUTO_PARK_MODE:
12835
           if (current_position[E_AXIS] == destination[E_AXIS]) {
12836
           if (current_position[E_AXIS] == destination[E_AXIS]) {
12836
             // This is a travel move (with no extrusion)
12837
             // This is a travel move (with no extrusion)
12859
             if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Clear active_extruder_parked");
12860
             if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Clear active_extruder_parked");
12860
           #endif
12861
           #endif
12861
           break;
12862
           break;
12863
+
12862
         case DXC_DUPLICATION_MODE:
12864
         case DXC_DUPLICATION_MODE:
12863
           if (active_extruder == 0) {
12865
           if (active_extruder == 0) {
12864
             #if ENABLED(DEBUG_LEVELING_FEATURE)
12866
             #if ENABLED(DEBUG_LEVELING_FEATURE)
12894
           }
12896
           }
12895
           break;
12897
           break;
12896
       }
12898
       }
12897
-    }
12898
-    return (
12899
-      #if UBL_SEGMENTED
12900
-        ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s))
12901
-      #else
12902
-        prepare_move_to_destination_cartesian()
12903
-      #endif
12904
-    );
12899
+    return false;
12905
   }
12900
   }
12906
 
12901
 
12907
 #endif // DUAL_X_CARRIAGE
12902
 #endif // DUAL_X_CARRIAGE
12942
 
12937
 
12943
   #endif
12938
   #endif
12944
 
12939
 
12940
+  #if ENABLED(DUAL_X_CARRIAGE)
12941
+    if (dual_x_carriage_unpark()) return;
12942
+  #endif
12943
+
12945
   if (
12944
   if (
12946
-    #if ENABLED(DUAL_X_CARRIAGE)
12947
-      prepare_move_to_destination_dualx()
12948
-    #elif UBL_SEGMENTED
12945
+    #if UBL_SEGMENTED
12949
       ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s))
12946
       ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s))
12950
     #elif IS_KINEMATIC
12947
     #elif IS_KINEMATIC
12951
       prepare_kinematic_move_to(destination)
12948
       prepare_kinematic_move_to(destination)

Loading…
Cancel
Save