From 7b4bdc0203561fd66b4d37b9e322530bec83a92b Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Wed, 30 Sep 2015 04:20:31 -0500 Subject: [PATCH] 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. --- Marlin/planner.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 0b7c9faab0..9032eba463 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -110,7 +110,7 @@ long position[NUM_AXIS]; // Rescaled from extern when axis_steps_p static float previous_speed[NUM_AXIS]; // Speed of previous path line segment static float previous_nominal_speed; // Nominal speed of previous path line segment -unsigned char g_uc_extruder_last_move[4] = {0,0,0,0}; +uint8_t g_uc_extruder_last_move[EXTRUDERS] = { 0 }; #ifdef XY_FREQUENCY_LIMIT // Used for the frequency limit @@ -125,6 +125,10 @@ unsigned char g_uc_extruder_last_move[4] = {0,0,0,0}; static char meas_sample; //temporary variable to hold filament measurement sample #endif +#if ENABLED(DUAL_X_CARRIAGE) + extern bool extruder_duplication_enabled; +#endif + //=========================================================================== //================================ functions ================================ //=========================================================================== @@ -628,6 +632,12 @@ float junction_deviation = 0.1; switch(extruder) { case 0: enable_e0(); + #if ENABLED(DUAL_X_CARRIAGE) + if (extruder_duplication_enabled) { + enable_e1(); + g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2; + } + #endif g_uc_extruder_last_move[0] = BLOCK_BUFFER_SIZE * 2; #if EXTRUDERS > 1 if (g_uc_extruder_last_move[1] == 0) disable_e1();