|
@@ -36,6 +36,8 @@ FWRetract fwretract; // Single instance - this calls the constructor
|
36
|
36
|
#include "../module/planner.h"
|
37
|
37
|
#include "../module/stepper.h"
|
38
|
38
|
|
|
39
|
+#include "../gcode/parser.h"
|
|
40
|
+
|
39
|
41
|
#if ENABLED(RETRACT_SYNC_MIXING)
|
40
|
42
|
#include "mixing.h"
|
41
|
43
|
#endif
|
|
@@ -198,4 +200,78 @@ void FWRetract::retract(const bool retracting
|
198
|
200
|
//*/
|
199
|
201
|
}
|
200
|
202
|
|
|
203
|
+//extern const char SP_Z_STR[];
|
|
204
|
+
|
|
205
|
+/**
|
|
206
|
+ * M207: Set firmware retraction values
|
|
207
|
+ *
|
|
208
|
+ * S[+units] retract_length
|
|
209
|
+ * W[+units] swap_retract_length (multi-extruder)
|
|
210
|
+ * F[units/min] retract_feedrate_mm_s
|
|
211
|
+ * Z[units] retract_zraise
|
|
212
|
+ */
|
|
213
|
+void FWRetract::M207() {
|
|
214
|
+ if (!parser.seen("FSWZ")) return M207_report();
|
|
215
|
+ if (parser.seen('S')) settings.retract_length = parser.value_axis_units(E_AXIS);
|
|
216
|
+ if (parser.seen('F')) settings.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
|
|
217
|
+ if (parser.seen('Z')) settings.retract_zraise = parser.value_linear_units();
|
|
218
|
+ if (parser.seen('W')) settings.swap_retract_length = parser.value_axis_units(E_AXIS);
|
|
219
|
+}
|
|
220
|
+
|
|
221
|
+void FWRetract::M207_report(const bool forReplay/*=false*/) {
|
|
222
|
+ if (!forReplay) { SERIAL_ECHO_MSG("; Retract: S<length> F<units/m> Z<lift>"); SERIAL_ECHO_START(); }
|
|
223
|
+ SERIAL_ECHOLNPAIR_P(
|
|
224
|
+ PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length)
|
|
225
|
+ , PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length)
|
|
226
|
+ , PSTR(" F"), LINEAR_UNIT(MMS_TO_MMM(settings.retract_feedrate_mm_s))
|
|
227
|
+ , SP_Z_STR, LINEAR_UNIT(settings.retract_zraise)
|
|
228
|
+ );
|
|
229
|
+}
|
|
230
|
+
|
|
231
|
+/**
|
|
232
|
+ * M208: Set firmware un-retraction values
|
|
233
|
+ *
|
|
234
|
+ * S[+units] retract_recover_extra (in addition to M207 S*)
|
|
235
|
+ * W[+units] swap_retract_recover_extra (multi-extruder)
|
|
236
|
+ * F[units/min] retract_recover_feedrate_mm_s
|
|
237
|
+ * R[units/min] swap_retract_recover_feedrate_mm_s
|
|
238
|
+ */
|
|
239
|
+void FWRetract::M208() {
|
|
240
|
+ if (!parser.seen("FSRW")) return M208_report();
|
|
241
|
+ if (parser.seen('S')) settings.retract_recover_extra = parser.value_axis_units(E_AXIS);
|
|
242
|
+ if (parser.seen('F')) settings.retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
|
|
243
|
+ if (parser.seen('R')) settings.swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
|
|
244
|
+ if (parser.seen('W')) settings.swap_retract_recover_extra = parser.value_axis_units(E_AXIS);
|
|
245
|
+}
|
|
246
|
+
|
|
247
|
+void FWRetract::M208_report(const bool forReplay/*=false*/) {
|
|
248
|
+ if (!forReplay) { SERIAL_ECHO_MSG("; Recover: S<length> F<units/m>"); SERIAL_ECHO_START(); }
|
|
249
|
+ SERIAL_ECHOLNPAIR(
|
|
250
|
+ " M208 S", LINEAR_UNIT(settings.retract_recover_extra)
|
|
251
|
+ , " W", LINEAR_UNIT(settings.swap_retract_recover_extra)
|
|
252
|
+ , " F", LINEAR_UNIT(MMS_TO_MMM(settings.retract_recover_feedrate_mm_s))
|
|
253
|
+ );
|
|
254
|
+}
|
|
255
|
+
|
|
256
|
+#if ENABLED(FWRETRACT_AUTORETRACT)
|
|
257
|
+
|
|
258
|
+ /**
|
|
259
|
+ * M209: Enable automatic retract (M209 S1)
|
|
260
|
+ * For slicers that don't support G10/11, reversed extrude-only
|
|
261
|
+ * moves will be classified as retraction.
|
|
262
|
+ */
|
|
263
|
+ void FWRetract::M209() {
|
|
264
|
+ if (!parser.seen('S')) return M209_report();
|
|
265
|
+ if (MIN_AUTORETRACT <= MAX_AUTORETRACT)
|
|
266
|
+ enable_autoretract(parser.value_bool());
|
|
267
|
+ }
|
|
268
|
+
|
|
269
|
+ void FWRetract::M209_report(const bool forReplay/*=false*/) {
|
|
270
|
+ if (!forReplay) { SERIAL_ECHO_MSG("; Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover"); SERIAL_ECHO_START(); }
|
|
271
|
+ SERIAL_ECHOLNPAIR(" M209 S", autoretract_enabled);
|
|
272
|
+ }
|
|
273
|
+
|
|
274
|
+#endif // FWRETRACT_AUTORETRACT
|
|
275
|
+
|
|
276
|
+
|
201
|
277
|
#endif // FWRETRACT
|