Merge pull request #3788 from thinkyhead/rc_dual_x_compile_fix

DUAL_X_CARRIAGE fixes, improvements, Travis test
This commit is contained in:
Scott Lahteine 2016-05-18 16:56:54 -07:00
commit 138c5c8378
5 changed files with 26 additions and 13 deletions

View File

@ -104,6 +104,16 @@ script:
- opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT
- build_marlin - 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 ### ### LCDS ###
# #
# #

View File

@ -129,6 +129,10 @@ void idle(
void manage_inactivity(bool ignore_stepper_queue = false); 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 #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 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) #define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0)

View File

@ -398,14 +398,18 @@
* Dual X Carriage requirements * Dual X Carriage requirements
*/ */
#if ENABLED(DUAL_X_CARRIAGE) #if ENABLED(DUAL_X_CARRIAGE)
#if EXTRUDERS == 1 || ENABLED(COREXY) \ #if EXTRUDERS == 1
|| !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \ #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
|| !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \ #elif ENABLED(COREXY) || ENABLED(COREXZ)
|| !HAS_X_MAX #error "DUAL_X_CARRIAGE cannot be used with COREXY or COREXZ."
#error "Missing or invalid definitions for DUAL_X_CARRIAGE mode." #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR
#endif #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
#if X_HOME_DIR != -1 || X2_HOME_DIR != 1 #elif !HAS_X_MAX
#error "Please use canonical x-carriage assignment." #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
#endif // DUAL_X_CARRIAGE #endif // DUAL_X_CARRIAGE

View File

@ -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} }; static long axis_segment_time[2][3] = { {MAX_FREQ_TIME + 1, 0, 0}, {MAX_FREQ_TIME + 1, 0, 0} };
#endif #endif
#if ENABLED(DUAL_X_CARRIAGE)
extern bool extruder_duplication_enabled;
#endif
public: public:
Planner(); Planner();

View File

@ -193,7 +193,6 @@
#define NORM_E_DIR() _NORM_E_DIR() #define NORM_E_DIR() _NORM_E_DIR()
#define REV_E_DIR() _REV_E_DIR() #define REV_E_DIR() _REV_E_DIR()
#else #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 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 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();} #define REV_E_DIR() {if(extruder_duplication_enabled){E0_DIR_WRITE(INVERT_E0_DIR);E1_DIR_WRITE(INVERT_E1_DIR);}else _REV_E_DIR();}