|
@@ -95,7 +95,7 @@ void FWRetract::reset() {
|
95
|
95
|
*/
|
96
|
96
|
void FWRetract::retract(const bool retracting
|
97
|
97
|
#if EXTRUDERS > 1
|
98
|
|
- , bool swapping /* =false */
|
|
98
|
+ , bool swapping/*=false*/
|
99
|
99
|
#endif
|
100
|
100
|
) {
|
101
|
101
|
// Prevent two retracts or recovers in a row
|
|
@@ -128,12 +128,8 @@ void FWRetract::retract(const bool retracting
|
128
|
128
|
SERIAL_ECHOLNPAIR("current_hop ", current_hop);
|
129
|
129
|
//*/
|
130
|
130
|
|
131
|
|
- const float base_retract = (
|
132
|
|
- (swapping ? settings.swap_retract_length : settings.retract_length)
|
133
|
|
- #if ENABLED(RETRACT_SYNC_MIXING)
|
134
|
|
- * (MIXING_STEPPERS)
|
135
|
|
- #endif
|
136
|
|
- );
|
|
131
|
+ const float base_retract = TERN(RETRACT_SYNC_MIXING, MIXING_STEPPERS, 1)
|
|
132
|
+ * (swapping ? settings.swap_retract_length : settings.retract_length);
|
137
|
133
|
|
138
|
134
|
// The current position will be the destination for E and Z moves
|
139
|
135
|
destination = current_position;
|
|
@@ -148,10 +144,7 @@ void FWRetract::retract(const bool retracting
|
148
|
144
|
// Retract by moving from a faux E position back to the current E position
|
149
|
145
|
current_retract[active_extruder] = base_retract;
|
150
|
146
|
prepare_internal_move_to_destination( // set current to destination
|
151
|
|
- settings.retract_feedrate_mm_s
|
152
|
|
- #if ENABLED(RETRACT_SYNC_MIXING)
|
153
|
|
- * (MIXING_STEPPERS)
|
154
|
|
- #endif
|
|
147
|
+ settings.retract_feedrate_mm_s * TERN(RETRACT_SYNC_MIXING, MIXING_STEPPERS, 1)
|
155
|
148
|
);
|
156
|
149
|
|
157
|
150
|
// Is a Z hop set, and has the hop not yet been done?
|
|
@@ -177,18 +170,12 @@ void FWRetract::retract(const bool retracting
|
177
|
170
|
|
178
|
171
|
current_retract[active_extruder] = 0;
|
179
|
172
|
|
180
|
|
- const feedRate_t fr_mm_s = (
|
181
|
|
- (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s)
|
182
|
|
- #if ENABLED(RETRACT_SYNC_MIXING)
|
183
|
|
- * (MIXING_STEPPERS)
|
184
|
|
- #endif
|
185
|
|
- );
|
|
173
|
+ const feedRate_t fr_mm_s = TERN(RETRACT_SYNC_MIXING, MIXING_STEPPERS, 1)
|
|
174
|
+ * (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s);
|
186
|
175
|
prepare_internal_move_to_destination(fr_mm_s); // Recover E, set_current_to_destination
|
187
|
176
|
}
|
188
|
177
|
|
189
|
|
- #if ENABLED(RETRACT_SYNC_MIXING)
|
190
|
|
- mixer.T(old_mixing_tool); // Restore original mixing tool
|
191
|
|
- #endif
|
|
178
|
+ TERN_(RETRACT_SYNC_MIXING, mixer.T(old_mixing_tool)); // Restore original mixing tool
|
192
|
179
|
|
193
|
180
|
retracted[active_extruder] = retracting; // Active extruder now retracted / recovered
|
194
|
181
|
|