Browse Source

DUAL_X_CARRIAGE motor enabling

As noted by @darkjavi et.al. in #103, the E1 motor was not being enabled in planner.cpp when using DUAL_X_CARRIAGE. This patch enables and disables E1 as it should.
Richard Wackerbarth 9 years ago
parent
commit
7b4bdc0203
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      Marlin/planner.cpp

+ 11
- 1
Marlin/planner.cpp View File

110
 static float previous_speed[NUM_AXIS]; // Speed of previous path line segment
110
 static float previous_speed[NUM_AXIS]; // Speed of previous path line segment
111
 static float previous_nominal_speed;   // Nominal speed of previous path line segment
111
 static float previous_nominal_speed;   // Nominal speed of previous path line segment
112
 
112
 
113
-unsigned char g_uc_extruder_last_move[4] = {0,0,0,0};
113
+uint8_t g_uc_extruder_last_move[EXTRUDERS] = { 0 };
114
 
114
 
115
 #ifdef XY_FREQUENCY_LIMIT
115
 #ifdef XY_FREQUENCY_LIMIT
116
   // Used for the frequency limit
116
   // Used for the frequency limit
125
   static char meas_sample; //temporary variable to hold filament measurement sample
125
   static char meas_sample; //temporary variable to hold filament measurement sample
126
 #endif
126
 #endif
127
 
127
 
128
+#if ENABLED(DUAL_X_CARRIAGE)
129
+  extern bool extruder_duplication_enabled;
130
+#endif
131
+
128
 //===========================================================================
132
 //===========================================================================
129
 //================================ functions ================================
133
 //================================ functions ================================
130
 //===========================================================================
134
 //===========================================================================
628
       switch(extruder) {
632
       switch(extruder) {
629
         case 0:
633
         case 0:
630
           enable_e0();
634
           enable_e0();
635
+          #if ENABLED(DUAL_X_CARRIAGE)
636
+            if (extruder_duplication_enabled) {
637
+              enable_e1();
638
+              g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2;
639
+            }
640
+          #endif
631
           g_uc_extruder_last_move[0] = BLOCK_BUFFER_SIZE * 2;
641
           g_uc_extruder_last_move[0] = BLOCK_BUFFER_SIZE * 2;
632
           #if EXTRUDERS > 1
642
           #if EXTRUDERS > 1
633
             if (g_uc_extruder_last_move[1] == 0) disable_e1();
643
             if (g_uc_extruder_last_move[1] == 0) disable_e1();

Loading…
Cancel
Save