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

@ -1979,7 +1979,7 @@
* Universal tool change settings. * Universal tool change settings.
* Applies to all types of extruders except where explicitly noted. * Applies to all types of extruders except where explicitly noted.
*/ */
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
// Z raise distance for tool-change, as needed for some extruders // Z raise distance for tool-change, as needed for some extruders
#define TOOLCHANGE_ZRAISE 2 // (mm) #define TOOLCHANGE_ZRAISE 2 // (mm)
//#define TOOLCHANGE_ZRAISE_BEFORE_RETRACT // Apply raise before swap retraction (if enabled) //#define TOOLCHANGE_ZRAISE_BEFORE_RETRACT // Apply raise before swap retraction (if enabled)
@ -2043,7 +2043,7 @@
//#define TOOLCHANGE_PARK_X_ONLY // X axis only move //#define TOOLCHANGE_PARK_X_ONLY // X axis only move
//#define TOOLCHANGE_PARK_Y_ONLY // Y axis only move //#define TOOLCHANGE_PARK_Y_ONLY // Y axis only move
#endif #endif
#endif // EXTRUDERS > 1 #endif // HAS_MULTI_EXTRUDER
/** /**
* Advanced Pause * Advanced Pause

View File

@ -595,7 +595,7 @@
SPI_Enable(SPI0); SPI_Enable(SPI0);
SET_OUTPUT(DAC0_SYNC); SET_OUTPUT(DAC0_SYNC);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
SET_OUTPUT(DAC1_SYNC); SET_OUTPUT(DAC1_SYNC);
WRITE(DAC1_SYNC, HIGH); WRITE(DAC1_SYNC, HIGH);
#endif #endif

View File

@ -141,7 +141,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#error "Serial port pins (2) conflict with probe pin!" #error "Serial port pins (2) conflict with probe pin!"
#elif IS_TX2(X_ENABLE_PIN) || IS_RX2(X_DIR_PIN) || IS_TX2(Y_ENABLE_PIN) || IS_RX2(Y_DIR_PIN) #elif IS_TX2(X_ENABLE_PIN) || IS_RX2(X_DIR_PIN) || IS_TX2(Y_ENABLE_PIN) || IS_RX2(Y_DIR_PIN)
#error "Serial port pins (2) conflict with X/Y stepper pins!" #error "Serial port pins (2) conflict with X/Y stepper pins!"
#elif EXTRUDERS > 1 && (IS_TX2(E1_ENABLE_PIN) || (AXIS_HAS_SPI(E1) && IS_TX2(E1_CS_PIN))) #elif HAS_MULTI_EXTRUDER && (IS_TX2(E1_ENABLE_PIN) || (AXIS_HAS_SPI(E1) && IS_TX2(E1_CS_PIN)))
#error "Serial port pins (2) conflict with E1 stepper pins!" #error "Serial port pins (2) conflict with E1 stepper pins!"
#elif EXTRUDERS && (IS_RX2(E0_DIR_PIN) || IS_RX2(E0_STEP_PIN)) #elif EXTRUDERS && (IS_RX2(E0_DIR_PIN) || IS_RX2(E0_STEP_PIN))
#error "Serial port pins (2) conflict with E stepper pins!" #error "Serial port pins (2) conflict with E stepper pins!"
@ -168,7 +168,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#error "Serial port pins (3) conflict with Z3 pins!" #error "Serial port pins (3) conflict with Z3 pins!"
#elif PIN_IS_TX3(Z4_DIR) || PIN_IS_RX3(Z4_STEP) #elif PIN_IS_TX3(Z4_DIR) || PIN_IS_RX3(Z4_STEP)
#error "Serial port pins (3) conflict with Z4 pins!" #error "Serial port pins (3) conflict with Z4 pins!"
#elif EXTRUDERS > 1 && (PIN_IS_TX3(E1_DIR) || PIN_IS_RX3(E1_STEP)) #elif HAS_MULTI_EXTRUDER && (PIN_IS_TX3(E1_DIR) || PIN_IS_RX3(E1_STEP))
#error "Serial port pins (3) conflict with E1 pins!" #error "Serial port pins (3) conflict with E1 pins!"
#endif #endif
#undef PIN_IS_TX3 #undef PIN_IS_TX3
@ -214,7 +214,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#error "One or more i2c (1) pins overlaps with Z3 pins! Disable i2c peripherals." #error "One or more i2c (1) pins overlaps with Z3 pins! Disable i2c peripherals."
#elif PIN_IS_SDA1(Z4_DIR) || PIN_IS_SCL1(Z4_STEP) #elif PIN_IS_SDA1(Z4_DIR) || PIN_IS_SCL1(Z4_STEP)
#error "One or more i2c (1) pins overlaps with Z4 pins! Disable i2c peripherals." #error "One or more i2c (1) pins overlaps with Z4 pins! Disable i2c peripherals."
#elif EXTRUDERS > 1 && (PIN_IS_SDA1(E1_DIR) || PIN_IS_SCL1(E1_STEP)) #elif HAS_MULTI_EXTRUDER && (PIN_IS_SDA1(E1_DIR) || PIN_IS_SCL1(E1_STEP))
#error "One or more i2c (1) pins overlaps with E1 pins! Disable i2c peripherals." #error "One or more i2c (1) pins overlaps with E1 pins! Disable i2c peripherals."
#endif #endif
#undef PIN_IS_SDA1 #undef PIN_IS_SDA1
@ -240,9 +240,9 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#error "i2c SDA2 overlaps with Z3 enable pin! Disable i2c peripherals." #error "i2c SDA2 overlaps with Z3 enable pin! Disable i2c peripherals."
#elif PIN_IS_SDA2(Z4_ENABLE) #elif PIN_IS_SDA2(Z4_ENABLE)
#error "i2c SDA2 overlaps with Z4 enable pin! Disable i2c peripherals." #error "i2c SDA2 overlaps with Z4 enable pin! Disable i2c peripherals."
#elif EXTRUDERS > 1 && PIN_IS_SDA2(E1_ENABLE) #elif HAS_MULTI_EXTRUDER && PIN_IS_SDA2(E1_ENABLE)
#error "i2c SDA2 overlaps with E1 enable pin! Disable i2c peripherals." #error "i2c SDA2 overlaps with E1 enable pin! Disable i2c peripherals."
#elif EXTRUDERS > 1 && AXIS_HAS_SPI(E1) && PIN_IS_SDA2(E1_CS) #elif HAS_MULTI_EXTRUDER && AXIS_HAS_SPI(E1) && PIN_IS_SDA2(E1_CS)
#error "i2c SDA2 overlaps with E1 CS pin! Disable i2c peripherals." #error "i2c SDA2 overlaps with E1 CS pin! Disable i2c peripherals."
#elif EXTRUDERS && (PIN_IS_SDA2(E0_STEP) || PIN_IS_SDA2(E0_DIR)) #elif EXTRUDERS && (PIN_IS_SDA2(E0_STEP) || PIN_IS_SDA2(E0_DIR))
#error "i2c SCL2 overlaps with E0 STEP/DIR pin! Disable i2c peripherals." #error "i2c SCL2 overlaps with E0 STEP/DIR pin! Disable i2c peripherals."

View File

@ -21,7 +21,7 @@ void dac084s085::begin() {
// All SPI chip-select HIGH // All SPI chip-select HIGH
SET_OUTPUT(DAC0_SYNC); SET_OUTPUT(DAC0_SYNC);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
SET_OUTPUT(DAC1_SYNC); SET_OUTPUT(DAC1_SYNC);
#endif #endif
cshigh(); cshigh();
@ -38,7 +38,7 @@ void dac084s085::begin() {
spiSend(SPI_CHAN_DAC, externalDac_buf, COUNT(externalDac_buf)); spiSend(SPI_CHAN_DAC, externalDac_buf, COUNT(externalDac_buf));
WRITE(DAC0_SYNC, HIGH); WRITE(DAC0_SYNC, HIGH);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
//init Piggy DAC //init Piggy DAC
DELAY_US(2); DELAY_US(2);
WRITE(DAC1_SYNC, LOW); WRITE(DAC1_SYNC, LOW);
@ -86,7 +86,7 @@ void dac084s085::setValue(const uint8_t channel, const uint8_t value) {
void dac084s085::cshigh() { void dac084s085::cshigh() {
WRITE(DAC0_SYNC, HIGH); WRITE(DAC0_SYNC, HIGH);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
WRITE(DAC1_SYNC, HIGH); WRITE(DAC1_SYNC, HIGH);
#endif #endif
WRITE(SPI_EEPROM1_CS, HIGH); WRITE(SPI_EEPROM1_CS, HIGH);

View File

@ -42,7 +42,7 @@ FWRetract fwretract; // Single instance - this calls the constructor
// private: // private:
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
bool FWRetract::retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted bool FWRetract::retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted
#endif #endif
@ -73,9 +73,7 @@ void FWRetract::reset() {
LOOP_L_N(i, EXTRUDERS) { LOOP_L_N(i, EXTRUDERS) {
retracted[i] = false; retracted[i] = false;
#if EXTRUDERS > 1 TERN_(HAS_MULTI_EXTRUDER, retracted_swap[i] = false);
retracted_swap[i] = false;
#endif
current_retract[i] = 0.0; current_retract[i] = 0.0;
} }
} }
@ -92,7 +90,7 @@ void FWRetract::reset() {
* included in the G-code. Use M207 Z0 to to prevent double hop. * included in the G-code. Use M207 Z0 to to prevent double hop.
*/ */
void FWRetract::retract(const bool retracting void FWRetract::retract(const bool retracting
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
, bool swapping/*=false*/ , bool swapping/*=false*/
#endif #endif
) { ) {
@ -100,7 +98,7 @@ void FWRetract::retract(const bool retracting
if (retracted[active_extruder] == retracting) return; if (retracted[active_extruder] == retracting) return;
// Prevent two swap-retract or recovers in a row // Prevent two swap-retract or recovers in a row
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
// Allow G10 S1 only after G11 // Allow G10 S1 only after G11
if (swapping && retracted_swap[active_extruder] == retracting) return; if (swapping && retracted_swap[active_extruder] == retracting) return;
// G11 priority to recover the long retract if activated // G11 priority to recover the long retract if activated
@ -117,7 +115,7 @@ void FWRetract::retract(const bool retracting
); );
LOOP_L_N(i, EXTRUDERS) { LOOP_L_N(i, EXTRUDERS) {
SERIAL_ECHOLNPAIR("retracted[", i, "] ", retracted[i]); SERIAL_ECHOLNPAIR("retracted[", i, "] ", retracted[i]);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]); SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]);
#endif #endif
} }
@ -180,7 +178,7 @@ void FWRetract::retract(const bool retracting
retracted[active_extruder] = retracting; // Active extruder now retracted / recovered retracted[active_extruder] = retracting; // Active extruder now retracted / recovered
// If swap retract/recover update the retracted_swap flag too // If swap retract/recover update the retracted_swap flag too
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
if (swapping) retracted_swap[active_extruder] = retracting; if (swapping) retracted_swap[active_extruder] = retracting;
#endif #endif
@ -190,7 +188,7 @@ void FWRetract::retract(const bool retracting
SERIAL_ECHOLNPAIR("active_extruder ", active_extruder); SERIAL_ECHOLNPAIR("active_extruder ", active_extruder);
LOOP_L_N(i, EXTRUDERS) { LOOP_L_N(i, EXTRUDERS) {
SERIAL_ECHOLNPAIR("retracted[", i, "] ", retracted[i]); SERIAL_ECHOLNPAIR("retracted[", i, "] ", retracted[i]);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]); SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]);
#endif #endif
} }

View File

@ -42,7 +42,7 @@ typedef struct {
class FWRetract { class FWRetract {
private: private:
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
static bool retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted static bool retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted
#endif #endif
@ -75,7 +75,7 @@ public:
} }
static void retract(const bool retracting static void retract(const bool retracting
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
, bool swapping = false , bool swapping = false
#endif #endif
); );

View File

@ -186,13 +186,13 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=0*/
TERN_(HAS_POSITION_SHIFT, info.position_shift = position_shift); TERN_(HAS_POSITION_SHIFT, info.position_shift = position_shift);
info.feedrate = uint16_t(feedrate_mm_s * 60.0f); info.feedrate = uint16_t(feedrate_mm_s * 60.0f);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
info.active_extruder = active_extruder; info.active_extruder = active_extruder;
#endif #endif
#if DISABLED(NO_VOLUMETRICS) #if DISABLED(NO_VOLUMETRICS)
info.volumetric_enabled = parser.volumetric_enabled; info.volumetric_enabled = parser.volumetric_enabled;
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
for (int8_t e = 0; e < EXTRUDERS; e++) info.filament_size[e] = planner.filament_size[e]; for (int8_t e = 0; e < EXTRUDERS; e++) info.filament_size[e] = planner.filament_size[e];
#else #else
if (parser.volumetric_enabled) info.filament_size[0] = planner.filament_size[active_extruder]; if (parser.volumetric_enabled) info.filament_size[0] = planner.filament_size[active_extruder];
@ -369,7 +369,7 @@ void PrintJobRecovery::resume() {
// Recover volumetric extrusion state // Recover volumetric extrusion state
#if DISABLED(NO_VOLUMETRICS) #if DISABLED(NO_VOLUMETRICS)
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
for (int8_t e = 0; e < EXTRUDERS; e++) { for (int8_t e = 0; e < EXTRUDERS; e++) {
sprintf_P(cmd, PSTR("M200 T%i D%s"), e, dtostrf(info.filament_size[e], 1, 3, str_1)); sprintf_P(cmd, PSTR("M200 T%i D%s"), e, dtostrf(info.filament_size[e], 1, 3, str_1));
gcode.process_subcommands_now(cmd); gcode.process_subcommands_now(cmd);
@ -411,7 +411,7 @@ void PrintJobRecovery::resume() {
#endif #endif
// Select the previously active tool (with no_move) // Select the previously active tool (with no_move)
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
sprintf_P(cmd, PSTR("T%i S"), info.active_extruder); sprintf_P(cmd, PSTR("T%i S"), info.active_extruder);
gcode.process_subcommands_now(cmd); gcode.process_subcommands_now(cmd);
#endif #endif
@ -543,7 +543,7 @@ void PrintJobRecovery::resume() {
DEBUG_ECHOLNPAIR("feedrate: ", info.feedrate); DEBUG_ECHOLNPAIR("feedrate: ", info.feedrate);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
DEBUG_ECHOLNPAIR("active_extruder: ", int(info.active_extruder)); DEBUG_ECHOLNPAIR("active_extruder: ", int(info.active_extruder));
#endif #endif

View File

@ -58,7 +58,7 @@ typedef struct {
uint16_t feedrate; uint16_t feedrate;
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
uint8_t active_extruder; uint8_t active_extruder;
#endif #endif

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#include "../gcode.h" #include "../gcode.h"
#include "../../module/tool_change.h" #include "../../module/tool_change.h"
@ -170,4 +170,4 @@ void GcodeSuite::M217() {
M217_report(); M217_report();
} }
#endif // EXTRUDERS > 1 #endif // HAS_MULTI_EXTRUDER

View File

@ -23,7 +23,7 @@
#include "../gcode.h" #include "../gcode.h"
#include "../../module/tool_change.h" #include "../../module/tool_change.h"
#if ENABLED(DEBUG_LEVELING_FEATURE) || EXTRUDERS > 1 #if EITHER(HAS_MULTI_EXTRUDER, DEBUG_LEVELING_FEATURE)
#include "../../module/motion.h" #include "../../module/motion.h"
#endif #endif

View File

@ -33,11 +33,11 @@
* TODO: Handle 'G10 P' for tool settings and 'G10 L' for workspace settings * TODO: Handle 'G10 P' for tool settings and 'G10 L' for workspace settings
*/ */
void GcodeSuite::G10() { void GcodeSuite::G10() {
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
const bool rs = parser.boolval('S'); const bool rs = parser.boolval('S');
#endif #endif
fwretract.retract(true fwretract.retract(true
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
, rs , rs
#endif #endif
); );

View File

@ -29,7 +29,7 @@
#include "../../../module/motion.h" #include "../../../module/motion.h"
#include "../../../module/printcounter.h" #include "../../../module/printcounter.h"
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#include "../../../module/tool_change.h" #include "../../../module/tool_change.h"
#endif #endif
@ -105,7 +105,7 @@ void GcodeSuite::M600() {
if (!all_axes_known()) home_all_axes(); if (!all_axes_known()) home_all_axes();
#endif #endif
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
// Change toolhead if specified // Change toolhead if specified
const uint8_t active_extruder_before_filament_change = active_extruder; const uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder && TERN1(DUAL_X_CARRIAGE, !dxc_is_duplicating())) if (active_extruder != target_extruder && TERN1(DUAL_X_CARRIAGE, !dxc_is_duplicating()))
@ -163,7 +163,7 @@ void GcodeSuite::M600() {
#endif #endif
} }
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
// Restore toolhead if it was changed // Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder) if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, false); tool_change(active_extruder_before_filament_change, false);

View File

@ -29,7 +29,7 @@
#include "../../../module/motion.h" #include "../../../module/motion.h"
#include "../../../module/printcounter.h" #include "../../../module/printcounter.h"
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#include "../../../module/tool_change.h" #include "../../../module/tool_change.h"
#endif #endif

View File

@ -30,7 +30,7 @@
#include "../../../module/temperature.h" #include "../../../module/temperature.h"
#include "../../../feature/pause.h" #include "../../../feature/pause.h"
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#include "../../../module/tool_change.h" #include "../../../module/tool_change.h"
#endif #endif
@ -86,7 +86,7 @@ void GcodeSuite::M701() {
// Show initial "wait for load" message // Show initial "wait for load" message
TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder)); TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder));
#if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) #if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
// Change toolhead if specified // Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder; uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder) if (active_extruder != target_extruder)
@ -121,7 +121,7 @@ void GcodeSuite::M701() {
if (park_point.z > 0) if (park_point.z > 0)
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
#if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) #if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
// Restore toolhead if it was changed // Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder) if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, false); tool_change(active_extruder_before_filament_change, false);
@ -186,7 +186,7 @@ void GcodeSuite::M702() {
// Show initial "wait for unload" message // Show initial "wait for unload" message
TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder)); TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder));
#if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) #if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
// Change toolhead if specified // Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder; uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder) if (active_extruder != target_extruder)
@ -201,7 +201,7 @@ void GcodeSuite::M702() {
#if ENABLED(PRUSA_MMU2) #if ENABLED(PRUSA_MMU2)
mmu2.unload(); mmu2.unload();
#else #else
#if EXTRUDERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) #if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_UNLOAD_ALL_EXTRUDERS)
if (!parser.seenval('T')) { if (!parser.seenval('T')) {
HOTEND_LOOP() { HOTEND_LOOP() {
if (e != active_extruder) tool_change(e, false); if (e != active_extruder) tool_change(e, false);
@ -227,7 +227,7 @@ void GcodeSuite::M702() {
if (park_point.z > 0) if (park_point.z > 0)
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
#if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) #if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
// Restore toolhead if it was changed // Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder) if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, false); tool_change(active_extruder_before_filament_change, false);

View File

@ -614,7 +614,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 211: M211(); break; // M211: Enable, Disable, and/or Report software endstops case 211: M211(); break; // M211: Enable, Disable, and/or Report software endstops
#endif #endif
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
case 217: M217(); break; // M217: Set filament swap parameters case 217: M217(); break; // M217: Set filament swap parameters
#endif #endif

View File

@ -661,9 +661,7 @@ private:
static void M211(); static void M211();
#if EXTRUDERS > 1 TERN_(HAS_MULTI_EXTRUDER, static void M217());
static void M217();
#endif
TERN_(HAS_HOTEND_OFFSET, static void M218()); TERN_(HAS_HOTEND_OFFSET, static void M218());

View File

@ -501,6 +501,8 @@
#undef MK2_MULTIPLEXER #undef MK2_MULTIPLEXER
#undef PRUSA_MMU2 #undef PRUSA_MMU2
#undef HOTEND_IDLE_TIMEOUT #undef HOTEND_IDLE_TIMEOUT
#elif EXTRUDERS > 1
#define HAS_MULTI_EXTRUDER 1
#endif #endif
#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS #if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS

View File

@ -2334,7 +2334,7 @@
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0
#endif #endif
#if EXTRUDERS > 1 && !defined(TOOLCHANGE_FS_EXTRA_PRIME) #if HAS_MULTI_EXTRUDER && !defined(TOOLCHANGE_FS_EXTRA_PRIME)
#define TOOLCHANGE_FS_EXTRA_PRIME 0 #define TOOLCHANGE_FS_EXTRA_PRIME 0
#endif #endif

View File

@ -865,7 +865,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/** /**
* Options only for EXTRUDERS > 1 * Options only for EXTRUDERS > 1
*/ */
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#if EXTRUDERS > 8 #if EXTRUDERS > 8
#error "Marlin supports a maximum of 8 EXTRUDERS." #error "Marlin supports a maximum of 8 EXTRUDERS."
@ -987,7 +987,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Mixing Extruder requirements * Mixing Extruder requirements
*/ */
#if ENABLED(MIXING_EXTRUDER) #if ENABLED(MIXING_EXTRUDER)
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1." #error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1."
#elif MIXING_STEPPERS < 2 #elif MIXING_STEPPERS < 2
#error "You must set MIXING_STEPPERS >= 2 for a mixing extruder." #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."

View File

@ -96,7 +96,7 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) {
#else #else
PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT) PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT)
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) && EXTRUDERS > 1 #if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2)
PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT_STATE) PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT_STATE)
#else #else
PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2)

View File

@ -34,7 +34,7 @@ void LinearAdvanceScreen::onRedraw(draw_mode_t what) {
widgets_t w(what); widgets_t w(what);
w.precision(2, DEFAULT_LOWEST).color(e_axis); w.precision(2, DEFAULT_LOWEST).color(e_axis);
w.heading( GET_TEXT_F(MSG_LINEAR_ADVANCE)); w.heading( GET_TEXT_F(MSG_LINEAR_ADVANCE));
#if EXTRUDERS == 1 #if !HAS_MULTI_EXTRUDER
w.adjuster( 2, GET_TEXT_F(MSG_LINEAR_ADVANCE_K), getLinearAdvance_mm_mm_s(E0) ); w.adjuster( 2, GET_TEXT_F(MSG_LINEAR_ADVANCE_K), getLinearAdvance_mm_mm_s(E0) );
#else #else
w.adjuster( 2, GET_TEXT_F(MSG_LINEAR_ADVANCE_K1), getLinearAdvance_mm_mm_s(E0) ); w.adjuster( 2, GET_TEXT_F(MSG_LINEAR_ADVANCE_K1), getLinearAdvance_mm_mm_s(E0) );
@ -55,7 +55,7 @@ bool LinearAdvanceScreen::onTouchHeld(uint8_t tag) {
switch (tag) { switch (tag) {
case 2: UI_DECREMENT(LinearAdvance_mm_mm_s, E0); break; case 2: UI_DECREMENT(LinearAdvance_mm_mm_s, E0); break;
case 3: UI_INCREMENT(LinearAdvance_mm_mm_s, E0); break; case 3: UI_INCREMENT(LinearAdvance_mm_mm_s, E0); break;
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
case 4: UI_DECREMENT(LinearAdvance_mm_mm_s, E1); break; case 4: UI_DECREMENT(LinearAdvance_mm_mm_s, E1); break;
case 5: UI_INCREMENT(LinearAdvance_mm_mm_s, E1); break; case 5: UI_INCREMENT(LinearAdvance_mm_mm_s, E1); break;
#if EXTRUDERS > 2 #if EXTRUDERS > 2

View File

@ -41,7 +41,7 @@ void MaxVelocityScreen::onRedraw(draw_mode_t what) {
w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_VMAX_Z), getAxisMaxFeedrate_mm_s(Z) ); w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_VMAX_Z), getAxisMaxFeedrate_mm_s(Z) );
#if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS)
w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_VMAX_E), getAxisMaxFeedrate_mm_s(E0) ); w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_VMAX_E), getAxisMaxFeedrate_mm_s(E0) );
#elif EXTRUDERS > 1 #elif HAS_MULTI_EXTRUDER
w.heading(GET_TEXT_F(MSG_VMAX_E)); w.heading(GET_TEXT_F(MSG_VMAX_E));
w.color(e_axis) .adjuster( 8, F(LCD_STR_E0), getAxisMaxFeedrate_mm_s(E0) ); w.color(e_axis) .adjuster( 8, F(LCD_STR_E0), getAxisMaxFeedrate_mm_s(E0) );
w.color(e_axis) .adjuster( 10, F(LCD_STR_E1), getAxisMaxFeedrate_mm_s(E1) ); w.color(e_axis) .adjuster( 10, F(LCD_STR_E1), getAxisMaxFeedrate_mm_s(E1) );

View File

@ -55,7 +55,7 @@ void MoveAxisScreen::onRedraw(draw_mode_t what) {
w.color(Theme::e_axis); w.color(Theme::e_axis);
#if EXTRUDERS == 1 #if EXTRUDERS == 1
w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E), screen_data.MoveAxisScreen.e_rel[0], canMove(E0));
#elif EXTRUDERS > 1 #elif HAS_MULTI_EXTRUDER
w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), screen_data.MoveAxisScreen.e_rel[0], canMove(E0));
w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), screen_data.MoveAxisScreen.e_rel[1], canMove(E1)); w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), screen_data.MoveAxisScreen.e_rel[1], canMove(E1));
#if EXTRUDERS > 2 #if EXTRUDERS > 2
@ -82,7 +82,7 @@ bool MoveAxisScreen::onTouchHeld(uint8_t tag) {
// For extruders, also update relative distances. // For extruders, also update relative distances.
case 8: UI_DECREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] -= increment; break; case 8: UI_DECREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] -= increment; break;
case 9: UI_INCREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] += increment; break; case 9: UI_INCREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] += increment; break;
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
case 10: UI_DECREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] -= increment; break; case 10: UI_DECREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] -= increment; break;
case 11: UI_INCREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] += increment; break; case 11: UI_INCREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] += increment; break;
#endif #endif

View File

@ -33,7 +33,7 @@ using namespace ExtUI;
void NudgeNozzleScreen::onEntry() { void NudgeNozzleScreen::onEntry() {
screen_data.NudgeNozzleScreen.show_offsets = false; screen_data.NudgeNozzleScreen.show_offsets = false;
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
screen_data.NudgeNozzleScreen.link_nozzles = true; screen_data.NudgeNozzleScreen.link_nozzles = true;
#endif #endif
screen_data.NudgeNozzleScreen.rel.reset(); screen_data.NudgeNozzleScreen.rel.reset();
@ -52,11 +52,11 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) {
#endif #endif
w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzleScreen.rel.z / getAxisSteps_per_mm(Z)); w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzleScreen.rel.z / getAxisSteps_per_mm(Z));
w.increments(); w.increments();
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
w.toggle(8, GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles); w.toggle(8, GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles);
#endif #endif
#if EXTRUDERS > 1 || HAS_BED_PROBE #if HAS_MULTI_EXTRUDER || HAS_BED_PROBE
w.toggle(9, GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets); w.toggle(9, GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets);
if (screen_data.NudgeNozzleScreen.show_offsets) { if (screen_data.NudgeNozzleScreen.show_offsets) {
@ -82,7 +82,7 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) {
bool NudgeNozzleScreen::onTouchHeld(uint8_t tag) { bool NudgeNozzleScreen::onTouchHeld(uint8_t tag) {
const float inc = getIncrement(); const float inc = getIncrement();
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
const bool link = screen_data.NudgeNozzleScreen.link_nozzles; const bool link = screen_data.NudgeNozzleScreen.link_nozzles;
#else #else
constexpr bool link = true; constexpr bool link = true;
@ -95,13 +95,13 @@ bool NudgeNozzleScreen::onTouchHeld(uint8_t tag) {
case 5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzleScreen.rel.y += steps; break; case 5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzleScreen.rel.y += steps; break;
case 6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzleScreen.rel.z -= steps; break; case 6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzleScreen.rel.z -= steps; break;
case 7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzleScreen.rel.z += steps; break; case 7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzleScreen.rel.z += steps; break;
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
case 8: screen_data.NudgeNozzleScreen.link_nozzles = !link; break; case 8: screen_data.NudgeNozzleScreen.link_nozzles = !link; break;
#endif #endif
case 9: screen_data.NudgeNozzleScreen.show_offsets = !screen_data.NudgeNozzleScreen.show_offsets; break; case 9: screen_data.NudgeNozzleScreen.show_offsets = !screen_data.NudgeNozzleScreen.show_offsets; break;
default: return false; default: return false;
} }
#if EXTRUDERS > 1 || HAS_BED_PROBE #if HAS_MULTI_EXTRUDER || HAS_BED_PROBE
SaveSettingsDialogBox::settingsChanged(); SaveSettingsDialogBox::settingsChanged();
#endif #endif
return true; return true;

View File

@ -86,7 +86,7 @@ union screen_data_t {
struct { struct {
struct base_numeric_adjustment_t placeholder; struct base_numeric_adjustment_t placeholder;
xyz_int_t rel; xyz_int_t rel;
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
bool link_nozzles; bool link_nozzles;
#endif #endif
bool show_offsets; bool show_offsets;

View File

@ -40,7 +40,7 @@ void StepperCurrentScreen::onRedraw(draw_mode_t what) {
w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisCurrent_mA(Z) ); w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisCurrent_mA(Z) );
#if EXTRUDERS == 1 #if EXTRUDERS == 1
w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisCurrent_mA(E0) ); w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisCurrent_mA(E0) );
#elif EXTRUDERS > 1 #elif HAS_MULTI_EXTRUDER
w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), getAxisCurrent_mA(E0) ); w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), getAxisCurrent_mA(E0) );
w.color(e_axis).adjuster(10, GET_TEXT_F(MSG_AXIS_E2), getAxisCurrent_mA(E1) ); w.color(e_axis).adjuster(10, GET_TEXT_F(MSG_AXIS_E2), getAxisCurrent_mA(E1) );
#if EXTRUDERS > 2 #if EXTRUDERS > 2
@ -64,7 +64,7 @@ bool StepperCurrentScreen::onTouchHeld(uint8_t tag) {
case 7: UI_INCREMENT(AxisCurrent_mA, Z ); break; case 7: UI_INCREMENT(AxisCurrent_mA, Z ); break;
case 8: UI_DECREMENT(AxisCurrent_mA, E0); break; case 8: UI_DECREMENT(AxisCurrent_mA, E0); break;
case 9: UI_INCREMENT(AxisCurrent_mA, E0); break; case 9: UI_INCREMENT(AxisCurrent_mA, E0); break;
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
case 10: UI_DECREMENT(AxisCurrent_mA, E1); break; case 10: UI_DECREMENT(AxisCurrent_mA, E1); break;
case 11: UI_INCREMENT(AxisCurrent_mA, E1); break; case 11: UI_INCREMENT(AxisCurrent_mA, E1); break;
#endif #endif

View File

@ -40,7 +40,7 @@ void StepsScreen::onRedraw(draw_mode_t what) {
w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisSteps_per_mm(Z) ); w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisSteps_per_mm(Z) );
#if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS)
w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisSteps_per_mm(E0) ); w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisSteps_per_mm(E0) );
#elif EXTRUDERS > 1 #elif HAS_MULTI_EXTRUDER
w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), getAxisSteps_per_mm(E0) ); w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), getAxisSteps_per_mm(E0) );
w.color(e_axis) .adjuster(10, GET_TEXT_F(MSG_AXIS_E2), getAxisSteps_per_mm(E1) ); w.color(e_axis) .adjuster(10, GET_TEXT_F(MSG_AXIS_E2), getAxisSteps_per_mm(E1) );
#if EXTRUDERS > 2 #if EXTRUDERS > 2
@ -64,7 +64,7 @@ bool StepsScreen::onTouchHeld(uint8_t tag) {
case 7: UI_INCREMENT(AxisSteps_per_mm, Z); break; case 7: UI_INCREMENT(AxisSteps_per_mm, Z); break;
case 8: UI_DECREMENT(AxisSteps_per_mm, E0); break; case 8: UI_DECREMENT(AxisSteps_per_mm, E0); break;
case 9: UI_INCREMENT(AxisSteps_per_mm, E0); break; case 9: UI_INCREMENT(AxisSteps_per_mm, E0); break;
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
case 10: UI_DECREMENT(AxisSteps_per_mm, E1); break; case 10: UI_DECREMENT(AxisSteps_per_mm, E1); break;
case 11: UI_INCREMENT(AxisSteps_per_mm, E1); break; case 11: UI_INCREMENT(AxisSteps_per_mm, E1); break;
#endif #endif

View File

@ -127,9 +127,7 @@ void StressTestScreen::onIdle() {
injectCommands_P(PSTR( injectCommands_P(PSTR(
"G0 X100 Y100 Z100 F6000\n" "G0 X100 Y100 Z100 F6000\n"
"T0\nG4 S1" "T0\nG4 S1"
#if EXTRUDERS > 1 TERN_(HAS_MULTI_EXTRUDER, "\nT1\nG4 S1")
"\nT1\nG4 S1"
#endif
"\nG0 X150 Y150 Z150" "\nG0 X150 Y150 Z150"
)); ));
} }

View File

@ -70,7 +70,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
//planner.flow_percentage[1] = planner.flow_percentage[0]; //planner.flow_percentage[1] = planner.flow_percentage[0];
//planner.e_factor[1]= planner.flow_percentage[1]*0.01; //planner.e_factor[1]= planner.flow_percentage[1]*0.01;
planner.refresh_e_factor(0); planner.refresh_e_factor(0);
if (EXTRUDERS == 2) { #if HAS_MULTI_EXTRUDER
planner.flow_percentage[1] = planner.flow_percentage[0]; planner.flow_percentage[1] = planner.flow_percentage[0];
planner.refresh_e_factor(1); planner.refresh_e_factor(1);
} }

View File

@ -95,7 +95,7 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) {
//saved_feedrate_percentage = feedrate_percentage; //saved_feedrate_percentage = feedrate_percentage;
planner.flow_percentage[0] = 100; planner.flow_percentage[0] = 100;
planner.e_factor[0] = planner.flow_percentage[0] * 0.01f; planner.e_factor[0] = planner.flow_percentage[0] * 0.01f;
#if EXTRUDERS == 2 #if HAS_MULTI_EXTRUDER
planner.flow_percentage[1] = 100; planner.flow_percentage[1] = 100;
planner.e_factor[1] = planner.flow_percentage[1] * 0.01f; planner.e_factor[1] = planner.flow_percentage[1] * 0.01f;
#endif #endif

View File

@ -90,7 +90,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
// nothing to do // nothing to do
} }
else if (event == LV_EVENT_RELEASED) { else if (event == LV_EVENT_RELEASED) {
if (EXTRUDERS == 2) { if (ENABLED(HAS_MULTI_EXTRUDER)) {
if (uiCfg.curSprayerChoose == 0) { if (uiCfg.curSprayerChoose == 0) {
uiCfg.curSprayerChoose = 1; uiCfg.curSprayerChoose = 1;
queue.inject_P(PSTR("T1")); queue.inject_P(PSTR("T1"));

View File

@ -61,7 +61,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); thermalManager.start_watching_hotend(uiCfg.curSprayerChoose);
} }
} }
#if !defined(SINGLENOZZLE) && EXTRUDERS >= 2 #if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER
else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) {
thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); thermalManager.start_watching_hotend(uiCfg.curSprayerChoose);
@ -117,7 +117,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
} }
else if (event == LV_EVENT_RELEASED) { else if (event == LV_EVENT_RELEASED) {
if (uiCfg.curTempType == 0) { if (uiCfg.curTempType == 0) {
if (EXTRUDERS == 2) { if (ENABLED(HAS_MULTI_EXTRUDER)) {
if (uiCfg.curSprayerChoose == 0) { if (uiCfg.curSprayerChoose == 0) {
uiCfg.curSprayerChoose = 1; uiCfg.curSprayerChoose = 1;
} }

View File

@ -242,8 +242,10 @@ void lv_draw_printing(void) {
#endif // if 1 #endif // if 1
lv_obj_set_pos(buttonExt1, 205, 136); lv_obj_set_pos(buttonExt1, 205, 136);
if (EXTRUDERS == 2)
#if HAS_MULTI_EXTRUDER
lv_obj_set_pos(buttonExt2, 350, 136); lv_obj_set_pos(buttonExt2, 350, 136);
#endif
#if HAS_HEATED_BED #if HAS_HEATED_BED
lv_obj_set_pos(buttonBedstate, 205, 186); lv_obj_set_pos(buttonBedstate, 205, 186);
@ -275,11 +277,11 @@ void lv_draw_printing(void) {
lv_obj_set_style(labelExt1, &tft_style_label_rel); lv_obj_set_style(labelExt1, &tft_style_label_rel);
lv_obj_set_pos(labelExt1, 250, 146); lv_obj_set_pos(labelExt1, 250, 146);
if (EXTRUDERS == 2) { #if HAS_MULTI_EXTRUDER
labelExt2 = lv_label_create(scr, NULL); labelExt2 = lv_label_create(scr, NULL);
lv_obj_set_style(labelExt2, &tft_style_label_rel); lv_obj_set_style(labelExt2, &tft_style_label_rel);
lv_obj_set_pos(labelExt2, 395, 146); lv_obj_set_pos(labelExt2, 395, 146);
} #endif
#if HAS_HEATED_BED #if HAS_HEATED_BED
labelBed = lv_label_create(scr, NULL); labelBed = lv_label_create(scr, NULL);
@ -344,11 +346,11 @@ void disp_ext_temp() {
sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target); sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target);
lv_label_set_text(labelExt1, public_buf_l); lv_label_set_text(labelExt1, public_buf_l);
if (EXTRUDERS == 2) { #if HAS_MULTI_EXTRUDER
ZERO(public_buf_l); ZERO(public_buf_l);
sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target); sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target);
lv_label_set_text(labelExt2, public_buf_l); lv_label_set_text(labelExt2, public_buf_l);
} #endif
} }
void disp_bed_temp() { void disp_bed_temp() {

View File

@ -61,7 +61,7 @@
#include "../../libs/numtostr.h" #include "../../libs/numtostr.h"
#endif #endif
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#include "../../module/tool_change.h" #include "../../module/tool_change.h"
#endif #endif
@ -348,7 +348,7 @@ namespace ExtUI {
} }
void setActiveTool(const extruder_t extruder, bool no_move) { void setActiveTool(const extruder_t extruder, bool no_move) {
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
const uint8_t e = extruder - E0; const uint8_t e = extruder - E0;
if (e != active_extruder) tool_change(e, no_move); if (e != active_extruder) tool_change(e, no_move);
active_extruder = e; active_extruder = e;
@ -699,21 +699,17 @@ namespace ExtUI {
*/ */
void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles) { void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles) {
const float mm = steps * planner.steps_to_mm[axis]; const float mm = steps * planner.steps_to_mm[axis];
UNUSED(mm);
if (!babystepAxis_steps(steps, axis)) return; if (!babystepAxis_steps(steps, axis)) return;
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
// Make it so babystepping in Z adjusts the Z probe offset. // Make it so babystepping in Z adjusts the Z probe offset.
if (axis == Z if (axis == Z && TERN1(HAS_MULTI_EXTRUDER, linked_nozzles || active_extruder == 0))
#if EXTRUDERS > 1 probe.offset.z += mm;
&& (linked_nozzles || active_extruder == 0)
#endif
) probe.offset.z += mm;
#else
UNUSED(mm);
#endif #endif
#if EXTRUDERS > 1 && HAS_HOTEND_OFFSET #if HAS_MULTI_EXTRUDER && HAS_HOTEND_OFFSET
/** /**
* When linked_nozzles is false, as an axis is babystepped * When linked_nozzles is false, as an axis is babystepped
* adjust the hotend offsets so that the other nozzles are * adjust the hotend offsets so that the other nozzles are
@ -730,7 +726,6 @@ namespace ExtUI {
} }
#else #else
UNUSED(linked_nozzles); UNUSED(linked_nozzles);
UNUSED(mm);
#endif #endif
} }

View File

@ -111,7 +111,7 @@ void menu_backlash();
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
#if EXTRUDERS == 1 #if EXTRUDERS == 1
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999);
#elif EXTRUDERS > 1 #elif HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) LOOP_L_N(n, EXTRUDERS)
EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999); EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999);
#endif #endif
@ -122,7 +122,7 @@ void menu_backlash();
#if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
EDIT_ITEM_FAST(float42_52, MSG_VOLUMETRIC_LIMIT, &planner.volumetric_extruder_limit[active_extruder], 0.0f, 20.0f, planner.calculate_volumetric_extruder_limits); EDIT_ITEM_FAST(float42_52, MSG_VOLUMETRIC_LIMIT, &planner.volumetric_extruder_limit[active_extruder], 0.0f, 20.0f, planner.calculate_volumetric_extruder_limits);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) LOOP_L_N(n, EXTRUDERS)
EDIT_ITEM_FAST_N(float42_52, n, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[n], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits); EDIT_ITEM_FAST_N(float42_52, n, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[n], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits);
#endif #endif
@ -130,7 +130,7 @@ void menu_backlash();
if (parser.volumetric_enabled) { if (parser.volumetric_enabled) {
EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) LOOP_L_N(n, EXTRUDERS)
EDIT_ITEM_FAST_N(float43, n, MSG_FILAMENT_DIAM_E, &planner.filament_size[n], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); EDIT_ITEM_FAST_N(float43, n, MSG_FILAMENT_DIAM_E, &planner.filament_size[n], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
#endif #endif
@ -141,13 +141,13 @@ void menu_backlash();
constexpr float extrude_maxlength = TERN(PREVENT_LENGTHY_EXTRUDE, EXTRUDE_MAXLENGTH, 999); constexpr float extrude_maxlength = TERN(PREVENT_LENGTHY_EXTRUDE, EXTRUDE_MAXLENGTH, 999);
EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) LOOP_L_N(n, EXTRUDERS)
EDIT_ITEM_FAST_N(float3, n, MSG_FILAMENTUNLOAD_E, &fc_settings[n].unload_length, 0, extrude_maxlength); EDIT_ITEM_FAST_N(float3, n, MSG_FILAMENTUNLOAD_E, &fc_settings[n].unload_length, 0, extrude_maxlength);
#endif #endif
EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) LOOP_L_N(n, EXTRUDERS)
EDIT_ITEM_FAST_N(float3, n, MSG_FILAMENTLOAD_E, &fc_settings[n].load_length, 0, extrude_maxlength); EDIT_ITEM_FAST_N(float3, n, MSG_FILAMENTLOAD_E, &fc_settings[n].load_length, 0, extrude_maxlength);
#endif #endif
@ -583,7 +583,7 @@ void menu_advanced_settings() {
#elif ENABLED(LIN_ADVANCE) #elif ENABLED(LIN_ADVANCE)
#if EXTRUDERS == 1 #if EXTRUDERS == 1
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999);
#elif EXTRUDERS > 1 #elif HAS_MULTI_EXTRUDER
LOOP_L_N(n, E_STEPPERS) LOOP_L_N(n, E_STEPPERS)
EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999); EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999);
#endif #endif

View File

@ -94,7 +94,7 @@ void menu_advanced_settings();
#endif #endif
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#include "../../module/tool_change.h" #include "../../module/tool_change.h"
@ -280,17 +280,17 @@ void menu_advanced_settings();
EDIT_ITEM(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract); EDIT_ITEM(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract);
#endif #endif
EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT, &fwretract.settings.retract_length, 0, 100); EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT, &fwretract.settings.retract_length, 0, 100);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.settings.swap_retract_length, 0, 100); EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.settings.swap_retract_length, 0, 100);
#endif #endif
EDIT_ITEM(float3, MSG_CONTROL_RETRACTF, &fwretract.settings.retract_feedrate_mm_s, 1, 999); EDIT_ITEM(float3, MSG_CONTROL_RETRACTF, &fwretract.settings.retract_feedrate_mm_s, 1, 999);
EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_ZHOP, &fwretract.settings.retract_zraise, 0, 999); EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_ZHOP, &fwretract.settings.retract_zraise, 0, 999);
EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.settings.retract_recover_extra, -100, 100); EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.settings.retract_recover_extra, -100, 100);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.settings.swap_retract_recover_extra, -100, 100); EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.settings.swap_retract_recover_extra, -100, 100);
#endif #endif
EDIT_ITEM(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.settings.retract_recover_feedrate_mm_s, 1, 999); EDIT_ITEM(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.settings.retract_recover_feedrate_mm_s, 1, 999);
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
EDIT_ITEM(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.settings.swap_retract_recover_feedrate_mm_s, 1, 999); EDIT_ITEM(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.settings.swap_retract_recover_feedrate_mm_s, 1, 999);
#endif #endif
END_MENU(); END_MENU();
@ -380,7 +380,7 @@ void menu_configuration() {
// //
// Set single nozzle filament retract and prime length // Set single nozzle filament retract and prime length
// //
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
SUBMENU(MSG_TOOL_CHANGE, menu_tool_change); SUBMENU(MSG_TOOL_CHANGE, menu_tool_change);
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
SUBMENU(MSG_TOOL_MIGRATION, menu_toolchange_migration); SUBMENU(MSG_TOOL_MIGRATION, menu_toolchange_migration);

View File

@ -215,7 +215,7 @@ void menu_tune() {
#if EXTRUDERS #if EXTRUDERS
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); }); EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); });
// Flow En: // Flow En:
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) LOOP_L_N(n, EXTRUDERS)
EDIT_ITEM_N(int3, n, MSG_FLOW_N, &planner.flow_percentage[n], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); EDIT_ITEM_N(int3, n, MSG_FLOW_N, &planner.flow_percentage[n], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
#endif #endif
@ -227,7 +227,7 @@ void menu_tune() {
#if ENABLED(LIN_ADVANCE) && DISABLED(SLIM_LCD_MENUS) #if ENABLED(LIN_ADVANCE) && DISABLED(SLIM_LCD_MENUS)
#if EXTRUDERS == 1 #if EXTRUDERS == 1
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999);
#elif EXTRUDERS > 1 #elif HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) LOOP_L_N(n, EXTRUDERS)
EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999); EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999);
#endif #endif

View File

@ -695,7 +695,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
#if IS_KINEMATIC #if IS_KINEMATIC
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
const int8_t old_extruder = active_extruder; const int8_t old_extruder = active_extruder;
if (axis == E_AXIS) active_extruder = e_index; if (axis == E_AXIS) active_extruder = e_index;
#endif #endif
@ -716,9 +716,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination
processing = false; processing = false;
#if EXTRUDERS > 1 TERN_(HAS_MULTI_EXTRUDER, active_extruder = old_extruder);
active_extruder = old_extruder;
#endif
#else #else

View File

@ -505,7 +505,7 @@ void Endstops::update() {
// With Dual X, endstops are only checked in the homing direction for the active extruder // With Dual X, endstops are only checked in the homing direction for the active extruder
#if ENABLED(DUAL_X_CARRIAGE) #if ENABLED(DUAL_X_CARRIAGE)
#define E0_ACTIVE stepper.movement_extruder() == 0 #define E0_ACTIVE stepper.last_moved_extruder == 0
#define X_MIN_TEST() ((X_HOME_DIR < 0 && E0_ACTIVE) || (X2_HOME_DIR < 0 && !E0_ACTIVE)) #define X_MIN_TEST() ((X_HOME_DIR < 0 && E0_ACTIVE) || (X2_HOME_DIR < 0 && !E0_ACTIVE))
#define X_MAX_TEST() ((X_HOME_DIR > 0 && E0_ACTIVE) || (X2_HOME_DIR > 0 && !E0_ACTIVE)) #define X_MAX_TEST() ((X_HOME_DIR > 0 && E0_ACTIVE) || (X2_HOME_DIR > 0 && !E0_ACTIVE))
#else #else

View File

@ -111,7 +111,7 @@ xyze_pos_t destination; // {0}
#endif #endif
// The active extruder (tool). Set with T<extruder> command. // The active extruder (tool). Set with T<extruder> command.
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
uint8_t active_extruder = 0; // = 0 uint8_t active_extruder = 0; // = 0
#endif #endif

View File

@ -98,7 +98,7 @@ extern feedRate_t feedrate_mm_s;
extern int16_t feedrate_percentage; extern int16_t feedrate_percentage;
// The active extruder (tool). Set with T<extruder> command. // The active extruder (tool). Set with T<extruder> command.
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
extern uint8_t active_extruder; extern uint8_t active_extruder;
#else #else
constexpr uint8_t active_extruder = 0; constexpr uint8_t active_extruder = 0;

View File

@ -1992,7 +1992,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
block->e_to_p_pressure = baricuda_e_to_p_pressure; block->e_to_p_pressure = baricuda_e_to_p_pressure;
#endif #endif
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
block->extruder = extruder; block->extruder = extruder;
#endif #endif
@ -2843,7 +2843,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i]; FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i];
#endif #endif
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
block->extruder = extruder; block->extruder = extruder;
#endif #endif

View File

@ -164,7 +164,7 @@ typedef struct block_t {
}; };
uint32_t step_event_count; // The number of step events required to complete this block uint32_t step_event_count; // The number of step events required to complete this block
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
uint8_t extruder; // The extruder to move (if E move) uint8_t extruder; // The extruder to move (if E move)
#else #else
static constexpr uint8_t extruder = 0; static constexpr uint8_t extruder = 0;

View File

@ -115,7 +115,7 @@
extern float other_extruder_advance_K[EXTRUDERS]; extern float other_extruder_advance_K[EXTRUDERS];
#endif #endif
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#include "tool_change.h" #include "tool_change.h"
void M217_report(const bool eeprom); void M217_report(const bool eeprom);
#endif #endif
@ -388,7 +388,7 @@ typedef struct SettingsDataStruct {
// //
// Tool-change settings // Tool-change settings
// //
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
toolchange_settings_t toolchange_settings; // M217 S P R toolchange_settings_t toolchange_settings; // M217 S P R
#endif #endif
@ -1320,7 +1320,7 @@ void MarlinSettings::postprocess() {
// Multiple Extruders // Multiple Extruders
// //
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
_FIELD_TEST(toolchange_settings); _FIELD_TEST(toolchange_settings);
EEPROM_WRITE(toolchange_settings); EEPROM_WRITE(toolchange_settings);
#endif #endif
@ -2167,7 +2167,7 @@ void MarlinSettings::postprocess() {
// //
// Tool-change settings // Tool-change settings
// //
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
_FIELD_TEST(toolchange_settings); _FIELD_TEST(toolchange_settings);
EEPROM_READ(toolchange_settings); EEPROM_READ(toolchange_settings);
#endif #endif
@ -2488,7 +2488,7 @@ void MarlinSettings::reset() {
// Tool-change Settings // Tool-change Settings
// //
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP) #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
toolchange_settings.swap_length = TOOLCHANGE_FS_LENGTH; toolchange_settings.swap_length = TOOLCHANGE_FS_LENGTH;
toolchange_settings.extra_resume = TOOLCHANGE_FS_EXTRA_RESUME_LENGTH; toolchange_settings.extra_resume = TOOLCHANGE_FS_EXTRA_RESUME_LENGTH;
@ -3719,7 +3719,7 @@ void MarlinSettings::reset() {
#endif #endif
#endif #endif
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
CONFIG_ECHO_HEADING("Tool-changing:"); CONFIG_ECHO_HEADING("Tool-changing:");
CONFIG_ECHO_START(); CONFIG_ECHO_START();
M217_report(true); M217_report(true);

View File

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

View File

@ -263,10 +263,10 @@ class Stepper {
static bool abort_current_block; // Signals to the stepper that current block should be aborted static bool abort_current_block; // Signals to the stepper that current block should be aborted
// Last-moved extruder, as set when the last movement was fetched from planner // Last-moved extruder, as set when the last movement was fetched from planner
#if EXTRUDERS < 2 #if HAS_MULTI_EXTRUDER
static constexpr uint8_t last_moved_extruder = 0;
#elif DISABLED(MIXING_EXTRUDER)
static uint8_t last_moved_extruder; static uint8_t last_moved_extruder;
#else
static constexpr uint8_t last_moved_extruder = 0;
#endif #endif
#if ENABLED(X_DUAL_ENDSTOPS) #if ENABLED(X_DUAL_ENDSTOPS)
@ -304,7 +304,7 @@ class Stepper {
decelerate_after, // The point from where we need to start decelerating decelerate_after, // The point from where we need to start decelerating
step_event_count; // The total event count for the current block step_event_count; // The total event count for the current block
#if EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) #if EITHER(HAS_MULTI_EXTRUDER, MIXING_EXTRUDER)
static uint8_t stepper_extruder; static uint8_t stepper_extruder;
#else #else
static constexpr uint8_t stepper_extruder = 0; static constexpr uint8_t stepper_extruder = 0;
@ -451,11 +451,6 @@ class Stepper {
// The last movement direction was not null on the specified axis. Note that motor direction is not necessarily the same. // The last movement direction was not null on the specified axis. Note that motor direction is not necessarily the same.
FORCE_INLINE static bool axis_is_moving(const AxisEnum axis) { return TEST(axis_did_move, axis); } FORCE_INLINE static bool axis_is_moving(const AxisEnum axis) { return TEST(axis_did_move, axis); }
// The extruder associated to the last movement
FORCE_INLINE static uint8_t movement_extruder() {
return (EXTRUDERS > 1 && DISABLED(MIXING_EXTRUDER)) ? last_moved_extruder : 0;
}
// Handle a triggered endstop // Handle a triggered endstop
static void endstop_triggered(const AxisEnum axis); static void endstop_triggered(const AxisEnum axis);

View File

@ -36,7 +36,7 @@
#define DEBUG_OUT ENABLED(DEBUG_TOOL_CHANGE) #define DEBUG_OUT ENABLED(DEBUG_TOOL_CHANGE)
#include "../core/debug_out.h" #include "../core/debug_out.h"
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
toolchange_settings_t toolchange_settings; // Initialized by settings.load() toolchange_settings_t toolchange_settings; // Initialized by settings.load()
#endif #endif
@ -870,7 +870,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
if (new_tool) invalid_extruder_error(new_tool); if (new_tool) invalid_extruder_error(new_tool);
return; return;
#else // EXTRUDERS > 1 #elif HAS_MULTI_EXTRUDER
planner.synchronize(); planner.synchronize();
@ -1197,7 +1197,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR(STR_ACTIVE_EXTRUDER, int(active_extruder)); SERIAL_ECHOLNPAIR(STR_ACTIVE_EXTRUDER, int(active_extruder));
#endif // EXTRUDERS > 1 #endif // HAS_MULTI_EXTRUDER
} }
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)

View File

@ -24,7 +24,7 @@
#include "../inc/MarlinConfigPre.h" #include "../inc/MarlinConfigPre.h"
#include "../core/types.h" #include "../core/types.h"
#if EXTRUDERS > 1 #if HAS_MULTI_EXTRUDER
typedef struct { typedef struct {
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP) #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)

View File

@ -354,7 +354,7 @@
#endif #endif
#endif #endif
#elif EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) #elif EITHER(HAS_MULTI_EXTRUDER, MIXING_EXTRUDER)
#undef _E1_PINS #undef _E1_PINS
#define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, _E1_CS _E1_MS1 _E1_MS2 _E1_MS3 #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, _E1_CS _E1_MS1 _E1_MS2 _E1_MS3
@ -383,7 +383,7 @@
#endif // EXTRUDERS > 3 || MIXING_EXTRUDER > 3 #endif // EXTRUDERS > 3 || MIXING_EXTRUDER > 3
#endif // EXTRUDERS > 2 || MIXING_EXTRUDER > 2 #endif // EXTRUDERS > 2 || MIXING_EXTRUDER > 2
#endif // EXTRUDERS > 1 || MIXING_EXTRUDER #endif // HAS_MULTI_EXTRUDER || MIXING_EXTRUDER
// //
// Heaters, Fans, Temp Sensors // Heaters, Fans, Temp Sensors

View File

@ -91,9 +91,6 @@
#if EXTRUDERS #if EXTRUDERS
#define HAS_EXTRUDERS #define HAS_EXTRUDERS
#if EXTRUDERS > 1
#define HAS_MULTI_EXTRUDER
#endif
#endif #endif
#if HAS_LCD_MENU #if HAS_LCD_MENU