From 516e79bbda89ab9be8adc40594c9f72440f1b911 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 18 May 2016 15:51:17 -0700 Subject: [PATCH 1/3] Declare extruder_duplication_enabled in Marlin.h --- Marlin/Marlin.h | 4 ++++ Marlin/planner.h | 4 ---- Marlin/stepper_indirection.h | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 358bcbe6a..ad0ffd520 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -129,6 +129,10 @@ void idle( void manage_inactivity(bool ignore_stepper_queue = false); +#if ENABLED(DUAL_X_CARRIAGE) + extern bool extruder_duplication_enabled; +#endif + #if ENABLED(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE #define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0) #define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0) diff --git a/Marlin/planner.h b/Marlin/planner.h index e1dc8941a..bd178d257 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -165,10 +165,6 @@ class Planner { static long axis_segment_time[2][3] = { {MAX_FREQ_TIME + 1, 0, 0}, {MAX_FREQ_TIME + 1, 0, 0} }; #endif - #if ENABLED(DUAL_X_CARRIAGE) - extern bool extruder_duplication_enabled; - #endif - public: Planner(); diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index 0a534efdd..c013d268e 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -193,7 +193,6 @@ #define NORM_E_DIR() _NORM_E_DIR() #define REV_E_DIR() _REV_E_DIR() #else - extern bool extruder_duplication_enabled; #define E_STEP_WRITE(v) {if(extruder_duplication_enabled){E0_STEP_WRITE(v);E1_STEP_WRITE(v);}else _E_STEP_WRITE(v);} #define NORM_E_DIR() {if(extruder_duplication_enabled){E0_DIR_WRITE(!INVERT_E0_DIR);E1_DIR_WRITE(!INVERT_E1_DIR);}else _NORM_E_DIR();} #define REV_E_DIR() {if(extruder_duplication_enabled){E0_DIR_WRITE(INVERT_E0_DIR);E1_DIR_WRITE(INVERT_E1_DIR);}else _REV_E_DIR();} From 2a7b1a85f7a0332a82d37311652dfee36200f102 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 18 May 2016 15:59:28 -0700 Subject: [PATCH 2/3] Improve DUAL_X_CARRIAGE sanity check errors --- Marlin/SanityCheck.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index c45c71614..c499c2c96 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -398,14 +398,18 @@ * Dual X Carriage requirements */ #if ENABLED(DUAL_X_CARRIAGE) - #if EXTRUDERS == 1 || ENABLED(COREXY) \ - || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \ - || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \ - || !HAS_X_MAX - #error "Missing or invalid definitions for DUAL_X_CARRIAGE mode." - #endif - #if X_HOME_DIR != -1 || X2_HOME_DIR != 1 - #error "Please use canonical x-carriage assignment." + #if EXTRUDERS == 1 + #error "DUAL_X_CARRIAGE requires 2 (or more) extruders." + #elif ENABLED(COREXY) || ENABLED(COREXZ) + #error "DUAL_X_CARRIAGE cannot be used with COREXY or COREXZ." + #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR + #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined." + #elif !HAS_X_MAX + #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop." + #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) + #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS." + #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1 + #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1." #endif #endif // DUAL_X_CARRIAGE From 7527fdec0ba5e9e1036e5ee5d0f6d8943914ff12 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 18 May 2016 16:05:19 -0700 Subject: [PATCH 3/3] Add Travis test for DUAL_X_CARRIAGE --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6b732fb6c..f32778b3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,6 +104,16 @@ script: - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT - build_marlin # + # Test DUAL_X_CARRIAGE + # + - restore_configs + - opt_set MOTHERBOARD BOARD_RAMPS_14_EEB + - opt_set EXTRUDERS 2 + - opt_set TEMP_SENSOR_1 1 + - opt_enable USE_XMAX_PLUG + - opt_enable_adv DUAL_X_CARRIAGE + - build_marlin + # ### LCDS ### # #