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 ### # # diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 04064701e..d5bd54f07 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/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 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();}