|
|
@ -36,6 +36,8 @@ FWRetract fwretract; // Single instance - this calls the constructor |
|
|
|
#include "../module/planner.h" |
|
|
|
#include "../module/stepper.h" |
|
|
|
|
|
|
|
#include "../gcode/parser.h" |
|
|
|
|
|
|
|
#if ENABLED(RETRACT_SYNC_MIXING) |
|
|
|
#include "mixing.h" |
|
|
|
#endif |
|
|
@ -198,4 +200,78 @@ void FWRetract::retract(const bool retracting |
|
|
|
//*/
|
|
|
|
} |
|
|
|
|
|
|
|
//extern const char SP_Z_STR[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* M207: Set firmware retraction values |
|
|
|
* |
|
|
|
* S[+units] retract_length |
|
|
|
* W[+units] swap_retract_length (multi-extruder) |
|
|
|
* F[units/min] retract_feedrate_mm_s |
|
|
|
* Z[units] retract_zraise |
|
|
|
*/ |
|
|
|
void FWRetract::M207() { |
|
|
|
if (!parser.seen("FSWZ")) return M207_report(); |
|
|
|
if (parser.seen('S')) settings.retract_length = parser.value_axis_units(E_AXIS); |
|
|
|
if (parser.seen('F')) settings.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); |
|
|
|
if (parser.seen('Z')) settings.retract_zraise = parser.value_linear_units(); |
|
|
|
if (parser.seen('W')) settings.swap_retract_length = parser.value_axis_units(E_AXIS); |
|
|
|
} |
|
|
|
|
|
|
|
void FWRetract::M207_report(const bool forReplay/*=false*/) { |
|
|
|
if (!forReplay) { SERIAL_ECHO_MSG("; Retract: S<length> F<units/m> Z<lift>"); SERIAL_ECHO_START(); } |
|
|
|
SERIAL_ECHOLNPAIR_P( |
|
|
|
PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length) |
|
|
|
, PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length) |
|
|
|
, PSTR(" F"), LINEAR_UNIT(MMS_TO_MMM(settings.retract_feedrate_mm_s)) |
|
|
|
, SP_Z_STR, LINEAR_UNIT(settings.retract_zraise) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/**
|
|
|
|
* M208: Set firmware un-retraction values |
|
|
|
* |
|
|
|
* S[+units] retract_recover_extra (in addition to M207 S*) |
|
|
|
* W[+units] swap_retract_recover_extra (multi-extruder) |
|
|
|
* F[units/min] retract_recover_feedrate_mm_s |
|
|
|
* R[units/min] swap_retract_recover_feedrate_mm_s |
|
|
|
*/ |
|
|
|
void FWRetract::M208() { |
|
|
|
if (!parser.seen("FSRW")) return M208_report(); |
|
|
|
if (parser.seen('S')) settings.retract_recover_extra = parser.value_axis_units(E_AXIS); |
|
|
|
if (parser.seen('F')) settings.retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); |
|
|
|
if (parser.seen('R')) settings.swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); |
|
|
|
if (parser.seen('W')) settings.swap_retract_recover_extra = parser.value_axis_units(E_AXIS); |
|
|
|
} |
|
|
|
|
|
|
|
void FWRetract::M208_report(const bool forReplay/*=false*/) { |
|
|
|
if (!forReplay) { SERIAL_ECHO_MSG("; Recover: S<length> F<units/m>"); SERIAL_ECHO_START(); } |
|
|
|
SERIAL_ECHOLNPAIR( |
|
|
|
" M208 S", LINEAR_UNIT(settings.retract_recover_extra) |
|
|
|
, " W", LINEAR_UNIT(settings.swap_retract_recover_extra) |
|
|
|
, " F", LINEAR_UNIT(MMS_TO_MMM(settings.retract_recover_feedrate_mm_s)) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
#if ENABLED(FWRETRACT_AUTORETRACT) |
|
|
|
|
|
|
|
/**
|
|
|
|
* M209: Enable automatic retract (M209 S1) |
|
|
|
* For slicers that don't support G10/11, reversed extrude-only |
|
|
|
* moves will be classified as retraction. |
|
|
|
*/ |
|
|
|
void FWRetract::M209() { |
|
|
|
if (!parser.seen('S')) return M209_report(); |
|
|
|
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) |
|
|
|
enable_autoretract(parser.value_bool()); |
|
|
|
} |
|
|
|
|
|
|
|
void FWRetract::M209_report(const bool forReplay/*=false*/) { |
|
|
|
if (!forReplay) { SERIAL_ECHO_MSG("; Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover"); SERIAL_ECHO_START(); } |
|
|
|
SERIAL_ECHOLNPAIR(" M209 S", autoretract_enabled); |
|
|
|
} |
|
|
|
|
|
|
|
#endif // FWRETRACT_AUTORETRACT
|
|
|
|
|
|
|
|
|
|
|
|
#endif // FWRETRACT
|
|
|
|