🐛 Fix MMU compile with >5 EXTRUDERS (#22036)

This commit is contained in:
Giuliano Zaro
2021-06-05 03:02:37 +02:00
committed by Scott Lahteine
parent ce95f56ac8
commit 04bea72787
10 changed files with 33 additions and 28 deletions

View File

@ -213,7 +213,7 @@ xyze_float_t Planner::previous_speed;
float Planner::previous_nominal_speed_sqr;
#if ENABLED(DISABLE_INACTIVE_EXTRUDER)
last_move_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 };
last_move_t Planner::g_uc_extruder_last_move[E_STEPPERS] = { 0 };
#endif
#ifdef XY_FREQUENCY_LIMIT
@ -2105,11 +2105,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder
LOOP_L_N(i, EXTRUDERS)
LOOP_L_N(i, E_STEPPERS)
if (g_uc_extruder_last_move[i]) g_uc_extruder_last_move[i]--;
#define E_STEPPER_INDEX(E) TERN(SWITCHING_EXTRUDER, (E) / 2, E)
#define ENABLE_ONE_E(N) do{ \
if (extruder == N) { \
if (E_STEPPER_INDEX(extruder) == N) { \
ENABLE_AXIS_E##N(); \
g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \
if ((N) == 0 && TERN0(HAS_DUPLICATION_MODE, extruder_duplication_enabled)) \
@ -2128,7 +2130,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#endif
REPEAT(EXTRUDERS, ENABLE_ONE_E); // (ENABLE_ONE_E must end with semicolon)
REPEAT(E_STEPPERS, ENABLE_ONE_E); // (ENABLE_ONE_E must end with semicolon)
}
#endif // EXTRUDERS

View File

@ -450,8 +450,8 @@ class Planner {
#endif
#if ENABLED(DISABLE_INACTIVE_EXTRUDER)
// Counters to manage disabling inactive extruders
static last_move_t g_uc_extruder_last_move[EXTRUDERS];
// Counters to manage disabling inactive extruder steppers
static last_move_t g_uc_extruder_last_move[E_STEPPERS];
#endif
#if HAS_WIRED_LCD

View File

@ -418,7 +418,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0)
#endif
#elif HAS_PRUSA_MMU2
#elif HAS_PRUSA_MMU2 // One multiplexed stepper driver
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
#define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)