🐛 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

@ -517,7 +517,7 @@
#define HAS_PRUSA_MMU2 1
#define HAS_PRUSA_MMU2S 1
#endif
#if MMU_MODEL == EXTENDABLE_EMU_MMU2 || MMU_MODEL == EXTENDABLE_EMU_MMU2S
#if MMU_MODEL >= EXTENDABLE_EMU_MMU2
#define HAS_EXTENDABLE_MMU 1
#endif
#endif

View File

@ -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
*/
#if HAS_PRUSA_MMU2
#if EXTRUDERS != 5
#if !HAS_EXTENDABLE_MMU && EXTRUDERS != 5
#undef SINGLENOZZLE
#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)
#error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
#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).");
#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
*/
#if HAS_MULTI_EXTRUDER
#if EXTRUDERS > 8
#error "Marlin supports a maximum of 8 EXTRUDERS."
#if HAS_EXTENDABLE_MMU
#define MAX_EXTRUDERS 15
#else
#define MAX_EXTRUDERS 8
#endif
static_assert(EXTRUDERS <= MAX_EXTRUDERS, "Marlin supports a maximum of " STRINGIFY(MAX_EXTRUDERS) " EXTRUDERS.");
#undef MAX_EXTRUDERS
#if ENABLED(HEATERS_PARALLEL)
#error "EXTRUDERS must be 1 with HEATERS_PARALLEL."