Skip to content

Commit

Permalink
Always swap with PRIME_FIRST_USED disabled (MarlinFirmware#21622)
Browse files Browse the repository at this point in the history
  • Loading branch information
soundstorm committed Apr 16, 2021
1 parent c6c6c56 commit 2d1d628
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,13 +928,15 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
#endif

// First tool priming. To prime again, reboot the machine.
#if BOTH(TOOLCHANGE_FILAMENT_SWAP, TOOLCHANGE_FS_PRIME_FIRST_USED)
#if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)
static bool first_tool_is_primed = false;
if (new_tool == old_tool && !first_tool_is_primed && enable_first_prime) {
tool_change_prime();
first_tool_is_primed = true;
toolchange_extruder_ready[old_tool] = true; // Primed and initialized
TERN_(TOOLCHANGE_FS_INIT_BEFORE_SWAP, toolchange_extruder_ready[old_tool] = true); // Primed and initialized
}
#else
constexpr bool first_tool_is_primed = true;
#endif

if (new_tool != old_tool || TERN0(PARKING_EXTRUDER, extruder_parked)) { // PARKING_EXTRUDER may need to attach old_tool when homing
Expand Down Expand Up @@ -970,12 +972,10 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
if (ENABLED(SINGLENOZZLE)) { active_extruder = new_tool; return; }
}
else {
#if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)
// For first new tool, change without unloading the old. 'Just prime/init the new'
if (first_tool_is_primed)
unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
first_tool_is_primed = true; // The first new tool will be primed by toolchanging
#endif
// For first new tool, change without unloading the old. 'Just prime/init the new'
if (first_tool_is_primed)
unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
TERN_(TOOLCHANGE_FS_PRIME_FIRST_USED, first_tool_is_primed = true); // The first new tool will be primed by toolchanging
}
}
#endif
Expand Down

0 comments on commit 2d1d628

Please sign in to comment.