🐛 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