|
@ -95,7 +95,7 @@ void FWRetract::reset() { |
|
|
*/ |
|
|
*/ |
|
|
void FWRetract::retract(const bool retracting |
|
|
void FWRetract::retract(const bool retracting |
|
|
#if EXTRUDERS > 1 |
|
|
#if EXTRUDERS > 1 |
|
|
, bool swapping /* =false */ |
|
|
, bool swapping/*=false*/ |
|
|
#endif |
|
|
#endif |
|
|
) { |
|
|
) { |
|
|
// Prevent two retracts or recovers in a row
|
|
|
// Prevent two retracts or recovers in a row
|
|
@ -128,12 +128,8 @@ void FWRetract::retract(const bool retracting |
|
|
SERIAL_ECHOLNPAIR("current_hop ", current_hop); |
|
|
SERIAL_ECHOLNPAIR("current_hop ", current_hop); |
|
|
//*/
|
|
|
//*/
|
|
|
|
|
|
|
|
|
const float base_retract = ( |
|
|
const float base_retract = TERN(RETRACT_SYNC_MIXING, MIXING_STEPPERS, 1) |
|
|
(swapping ? settings.swap_retract_length : settings.retract_length) |
|
|
* (swapping ? settings.swap_retract_length : settings.retract_length); |
|
|
#if ENABLED(RETRACT_SYNC_MIXING) |
|
|
|
|
|
* (MIXING_STEPPERS) |
|
|
|
|
|
#endif |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// The current position will be the destination for E and Z moves
|
|
|
// The current position will be the destination for E and Z moves
|
|
|
destination = current_position; |
|
|
destination = current_position; |
|
@ -148,10 +144,7 @@ void FWRetract::retract(const bool retracting |
|
|
// Retract by moving from a faux E position back to the current E position
|
|
|
// Retract by moving from a faux E position back to the current E position
|
|
|
current_retract[active_extruder] = base_retract; |
|
|
current_retract[active_extruder] = base_retract; |
|
|
prepare_internal_move_to_destination( // set current to destination
|
|
|
prepare_internal_move_to_destination( // set current to destination
|
|
|
settings.retract_feedrate_mm_s |
|
|
settings.retract_feedrate_mm_s * TERN(RETRACT_SYNC_MIXING, MIXING_STEPPERS, 1) |
|
|
#if ENABLED(RETRACT_SYNC_MIXING) |
|
|
|
|
|
* (MIXING_STEPPERS) |
|
|
|
|
|
#endif |
|
|
|
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
// Is a Z hop set, and has the hop not yet been done?
|
|
|
// Is a Z hop set, and has the hop not yet been done?
|
|
@ -177,18 +170,12 @@ void FWRetract::retract(const bool retracting |
|
|
|
|
|
|
|
|
current_retract[active_extruder] = 0; |
|
|
current_retract[active_extruder] = 0; |
|
|
|
|
|
|
|
|
const feedRate_t fr_mm_s = ( |
|
|
const feedRate_t fr_mm_s = TERN(RETRACT_SYNC_MIXING, MIXING_STEPPERS, 1) |
|
|
(swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s) |
|
|
* (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s); |
|
|
#if ENABLED(RETRACT_SYNC_MIXING) |
|
|
|
|
|
* (MIXING_STEPPERS) |
|
|
|
|
|
#endif |
|
|
|
|
|
); |
|
|
|
|
|
prepare_internal_move_to_destination(fr_mm_s); // Recover E, set_current_to_destination
|
|
|
prepare_internal_move_to_destination(fr_mm_s); // Recover E, set_current_to_destination
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#if ENABLED(RETRACT_SYNC_MIXING) |
|
|
TERN_(RETRACT_SYNC_MIXING, mixer.T(old_mixing_tool)); // Restore original mixing tool
|
|
|
mixer.T(old_mixing_tool); // Restore original mixing tool
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
retracted[active_extruder] = retracting; // Active extruder now retracted / recovered
|
|
|
retracted[active_extruder] = retracting; // Active extruder now retracted / recovered
|
|
|
|
|
|
|
|
|