Browse Source

Separate Dual X un-park from movement

Scott Lahteine 6 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,13 +12824,14 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12824 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 12831
       switch (dual_x_carriage_mode) {
12832
-        case DXC_FULL_CONTROL_MODE:
12833
-          break;
12832
+
12833
+        case DXC_FULL_CONTROL_MODE: break;
12834
+
12834 12835
         case DXC_AUTO_PARK_MODE:
12835 12836
           if (current_position[E_AXIS] == destination[E_AXIS]) {
12836 12837
             // This is a travel move (with no extrusion)
@@ -12859,6 +12860,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12859 12860
             if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Clear active_extruder_parked");
12860 12861
           #endif
12861 12862
           break;
12863
+
12862 12864
         case DXC_DUPLICATION_MODE:
12863 12865
           if (active_extruder == 0) {
12864 12866
             #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -12894,14 +12896,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12894 12896
           }
12895 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 12902
 #endif // DUAL_X_CARRIAGE
@@ -12942,10 +12937,12 @@ void prepare_move_to_destination() {
12942 12937
 
12943 12938
   #endif
12944 12939
 
12940
+  #if ENABLED(DUAL_X_CARRIAGE)
12941
+    if (dual_x_carriage_unpark()) return;
12942
+  #endif
12943
+
12945 12944
   if (
12946
-    #if ENABLED(DUAL_X_CARRIAGE)
12947
-      prepare_move_to_destination_dualx()
12948
-    #elif UBL_SEGMENTED
12945
+    #if UBL_SEGMENTED
12949 12946
       ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s))
12950 12947
     #elif IS_KINEMATIC
12951 12948
       prepare_kinematic_move_to(destination)

Loading…
Cancel
Save