🐛 Fix MMU compile with >5 EXTRUDERS (#22036)
This commit is contained in:
parent
ce95f56ac8
commit
04bea72787
|
@ -317,7 +317,7 @@ void disable_e_steppers() {
|
||||||
void disable_e_stepper(const uint8_t e) {
|
void disable_e_stepper(const uint8_t e) {
|
||||||
#define _CASE_DIS_E(N) case N: DISABLE_AXIS_E##N(); break;
|
#define _CASE_DIS_E(N) case N: DISABLE_AXIS_E##N(); break;
|
||||||
switch (e) {
|
switch (e) {
|
||||||
REPEAT(EXTRUDERS, _CASE_DIS_E)
|
REPEAT(E_STEPPERS, _CASE_DIS_E)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1423,10 +1423,7 @@ void setup() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_PRUSA_MMU1
|
#if HAS_PRUSA_MMU1
|
||||||
SETUP_LOG("Prusa MMU1");
|
SETUP_RUN(mmu_init());
|
||||||
SET_OUTPUT(E_MUX0_PIN);
|
|
||||||
SET_OUTPUT(E_MUX1_PIN);
|
|
||||||
SET_OUTPUT(E_MUX2_PIN);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_FANMUX
|
#if HAS_FANMUX
|
||||||
|
|
|
@ -24,7 +24,14 @@
|
||||||
|
|
||||||
#if HAS_PRUSA_MMU1
|
#if HAS_PRUSA_MMU1
|
||||||
|
|
||||||
#include "../module/stepper.h"
|
#include "../MarlinCore.h"
|
||||||
|
#include "../module/planner.h"
|
||||||
|
|
||||||
|
void mmu_init() {
|
||||||
|
SET_OUTPUT(E_MUX0_PIN);
|
||||||
|
SET_OUTPUT(E_MUX1_PIN);
|
||||||
|
SET_OUTPUT(E_MUX2_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
void select_multiplexed_stepper(const uint8_t e) {
|
void select_multiplexed_stepper(const uint8_t e) {
|
||||||
planner.synchronize();
|
planner.synchronize();
|
||||||
|
|
|
@ -21,4 +21,5 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
void mmu_init();
|
||||||
void select_multiplexed_stepper(const uint8_t e);
|
void select_multiplexed_stepper(const uint8_t e);
|
||||||
|
|
|
@ -517,7 +517,7 @@
|
||||||
#define HAS_PRUSA_MMU2 1
|
#define HAS_PRUSA_MMU2 1
|
||||||
#define HAS_PRUSA_MMU2S 1
|
#define HAS_PRUSA_MMU2S 1
|
||||||
#endif
|
#endif
|
||||||
#if MMU_MODEL == EXTENDABLE_EMU_MMU2 || MMU_MODEL == EXTENDABLE_EMU_MMU2S
|
#if MMU_MODEL >= EXTENDABLE_EMU_MMU2
|
||||||
#define HAS_EXTENDABLE_MMU 1
|
#define HAS_EXTENDABLE_MMU 1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -954,9 +954,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||||
* Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements
|
* Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements
|
||||||
*/
|
*/
|
||||||
#if HAS_PRUSA_MMU2
|
#if HAS_PRUSA_MMU2
|
||||||
#if EXTRUDERS != 5
|
#if !HAS_EXTENDABLE_MMU && EXTRUDERS != 5
|
||||||
#undef SINGLENOZZLE
|
#undef SINGLENOZZLE
|
||||||
#error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration."
|
#error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration."
|
||||||
|
#elif HAS_EXTENDABLE_MMU && EXTRUDERS > 15
|
||||||
|
#error "EXTRUDERS is too large for MMU(S) emulation mode. The maximum value is 15."
|
||||||
#elif DISABLED(NOZZLE_PARK_FEATURE)
|
#elif DISABLED(NOZZLE_PARK_FEATURE)
|
||||||
#error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
|
#error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
|
||||||
#elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR)
|
#elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR)
|
||||||
|
@ -969,18 +971,19 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||||
static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / HAS_EXTENDABLE_MMU(S).");
|
static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / HAS_EXTENDABLE_MMU(S).");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if HAS_EXTENDABLE_MMU && EXTRUDERS > 15
|
|
||||||
#error "Too many extruders for MMU(S) emulation mode. (15 maximum)."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options only for EXTRUDERS > 1
|
* Options only for EXTRUDERS > 1
|
||||||
*/
|
*/
|
||||||
#if HAS_MULTI_EXTRUDER
|
#if HAS_MULTI_EXTRUDER
|
||||||
|
|
||||||
#if EXTRUDERS > 8
|
#if HAS_EXTENDABLE_MMU
|
||||||
#error "Marlin supports a maximum of 8 EXTRUDERS."
|
#define MAX_EXTRUDERS 15
|
||||||
|
#else
|
||||||
|
#define MAX_EXTRUDERS 8
|
||||||
#endif
|
#endif
|
||||||
|
static_assert(EXTRUDERS <= MAX_EXTRUDERS, "Marlin supports a maximum of " STRINGIFY(MAX_EXTRUDERS) " EXTRUDERS.");
|
||||||
|
#undef MAX_EXTRUDERS
|
||||||
|
|
||||||
#if ENABLED(HEATERS_PARALLEL)
|
#if ENABLED(HEATERS_PARALLEL)
|
||||||
#error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
|
#error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
|
||||||
|
|
|
@ -213,7 +213,7 @@ xyze_float_t Planner::previous_speed;
|
||||||
float Planner::previous_nominal_speed_sqr;
|
float Planner::previous_nominal_speed_sqr;
|
||||||
|
|
||||||
#if ENABLED(DISABLE_INACTIVE_EXTRUDER)
|
#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
|
#endif
|
||||||
|
|
||||||
#ifdef XY_FREQUENCY_LIMIT
|
#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
|
#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]--;
|
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{ \
|
#define ENABLE_ONE_E(N) do{ \
|
||||||
if (extruder == N) { \
|
if (E_STEPPER_INDEX(extruder) == N) { \
|
||||||
ENABLE_AXIS_E##N(); \
|
ENABLE_AXIS_E##N(); \
|
||||||
g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \
|
g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \
|
||||||
if ((N) == 0 && TERN0(HAS_DUPLICATION_MODE, extruder_duplication_enabled)) \
|
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
|
#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
|
#endif // EXTRUDERS
|
||||||
|
|
||||||
|
|
|
@ -450,8 +450,8 @@ class Planner {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(DISABLE_INACTIVE_EXTRUDER)
|
#if ENABLED(DISABLE_INACTIVE_EXTRUDER)
|
||||||
// Counters to manage disabling inactive extruders
|
// Counters to manage disabling inactive extruder steppers
|
||||||
static last_move_t g_uc_extruder_last_move[EXTRUDERS];
|
static last_move_t g_uc_extruder_last_move[E_STEPPERS];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_WIRED_LCD
|
#if HAS_WIRED_LCD
|
||||||
|
|
|
@ -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)
|
#define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif HAS_PRUSA_MMU2
|
#elif HAS_PRUSA_MMU2 // One multiplexed stepper driver
|
||||||
|
|
||||||
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
|
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
|
||||||
#define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)
|
#define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)
|
||||||
|
|
|
@ -35,11 +35,6 @@
|
||||||
* These numbers are the same in any pin mapping.
|
* These numbers are the same in any pin mapping.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if HAS_EXTENDABLE_MMU
|
|
||||||
#define MAX_EXTRUDERS 15
|
|
||||||
#else
|
|
||||||
#define MAX_EXTRUDERS 8
|
|
||||||
#endif
|
|
||||||
#define MAX_E_STEPPERS 8
|
#define MAX_E_STEPPERS 8
|
||||||
|
|
||||||
#if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB)
|
#if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB)
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
|
|
||||||
#include "env_validate.h"
|
#include "env_validate.h"
|
||||||
|
|
||||||
#if HOTENDS > 8 || E_STEPPERS > 8
|
#if E_STEPPERS > MAX_E_STEPPERS
|
||||||
#error "BIGTREE GTR V1.0 supports up to 8 hotends / E-steppers."
|
|
||||||
#elif HOTENDS > MAX_E_STEPPERS || E_STEPPERS > MAX_E_STEPPERS
|
|
||||||
#error "Marlin extruder/hotends limit! Increase MAX_E_STEPPERS to continue."
|
#error "Marlin extruder/hotends limit! Increase MAX_E_STEPPERS to continue."
|
||||||
|
#elif HOTENDS > 8 || E_STEPPERS > 8
|
||||||
|
#error "BIGTREE GTR V1.0 supports up to 8 hotends / E-steppers."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BOARD_INFO_NAME "BTT GTR V1.0"
|
#define BOARD_INFO_NAME "BTT GTR V1.0"
|
||||||
|
|
Loading…
Reference in a new issue