Add multi-extruder condition

This commit is contained in:
Scott Lahteine
2020-09-20 18:29:08 -05:00
parent 8e0fac897b
commit 76d8d1742c
50 changed files with 127 additions and 144 deletions

View File

@@ -155,7 +155,7 @@ uint8_t Stepper::last_direction_bits, // = 0
bool Stepper::abort_current_block;
#if DISABLED(MIXING_EXTRUDER) && EXTRUDERS > 1
#if DISABLED(MIXING_EXTRUDER) && HAS_MULTI_EXTRUDER
uint8_t Stepper::last_moved_extruder = 0xFF;
#endif
@@ -191,7 +191,7 @@ uint32_t Stepper::advance_divisor = 0,
Stepper::decelerate_after, // The count at which to start decelerating
Stepper::step_event_count; // The total event count for the current block
#if EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER)
#if EITHER(HAS_MULTI_EXTRUDER, MIXING_EXTRUDER)
uint8_t Stepper::stepper_extruder;
#else
constexpr uint8_t Stepper::stepper_extruder;
@@ -357,11 +357,11 @@ xyze_int8_t Stepper::count_direction{0};
#elif ENABLED(DUAL_X_CARRIAGE)
#define X_APPLY_DIR(v,ALWAYS) do{ \
if (extruder_duplication_enabled || ALWAYS) { X_DIR_WRITE(v); X2_DIR_WRITE(mirrored_duplication_mode ? !(v) : v); } \
else if (movement_extruder()) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \
else if (last_moved_extruder) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \
}while(0)
#define X_APPLY_STEP(v,ALWAYS) do{ \
if (extruder_duplication_enabled || ALWAYS) { X_STEP_WRITE(v); X2_STEP_WRITE(v); } \
else if (movement_extruder()) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \
else if (last_moved_extruder) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \
}while(0)
#else
#define X_APPLY_DIR(v,Q) X_DIR_WRITE(v)
@@ -2131,7 +2131,7 @@ uint32_t Stepper::block_phase_isr() {
MIXER_STEPPER_SETUP();
#endif
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
stepper_extruder = current_block->extruder;
#endif
@@ -2156,7 +2156,7 @@ uint32_t Stepper::block_phase_isr() {
|| TERN(MIXING_EXTRUDER, false, stepper_extruder != last_moved_extruder)
) {
last_direction_bits = current_block->direction_bits;
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
last_moved_extruder = stepper_extruder;
#endif