Add option to enable/disable autoretract altogether (#11904)

This commit is contained in:
Victor Tseng
2018-09-29 05:52:56 +08:00
committed by Scott Lahteine
parent ad21a4f07b
commit 93839e2f73
63 changed files with 392 additions and 197 deletions

View File

@ -57,17 +57,18 @@ void GcodeSuite::M208() {
if (parser.seen('W')) fwretract.swap_retract_recover_length = parser.value_axis_units(E_AXIS);
}
/**
* M209: Enable automatic retract (M209 S1)
* For slicers that don't support G10/11, reversed extrude-only
* moves will be classified as retraction.
*/
void GcodeSuite::M209() {
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
if (parser.seen('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 GcodeSuite::M209() {
if (MIN_AUTORETRACT <= MAX_AUTORETRACT && parser.seen('S'))
fwretract.enable_autoretract(parser.value_bool());
}
}
}
#endif // FWRETRACT_AUTORETRACT
#endif // FWRETRACT

View File

@ -474,9 +474,11 @@ void GcodeSuite::process_parsed_command(
#if ENABLED(FWRETRACT)
case 207: M207(); break; // M207: Set Retract Length, Feedrate, and Z lift
case 208: M208(); break; // M208: Set Recover (unretract) Additional Length and Feedrate
case 209:
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) M209(); // M209: Turn Automatic Retract Detection on/off
break;
#if ENABLED(FWRETRACT_AUTORETRACT)
case 209:
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) M209(); // M209: Turn Automatic Retract Detection on/off
break;
#endif
#endif
case 211: M211(); break; // M211: Enable, Disable, and/or Report software endstops

View File

@ -161,7 +161,7 @@
* M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
* M207 - Set Retract Length: S<length>, Feedrate: F<units/min>, and Z lift: Z<distance>. (Requires FWRETRACT)
* M208 - Set Recover (unretract) Additional (!) Length: S<length> and Feedrate: F<units/min>. (Requires FWRETRACT)
* M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT)
* M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT_AUTORETRACT)
Every normal extrude-only move will be classified as retract depending on the direction.
* M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS)
* M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
@ -605,7 +605,9 @@ private:
#if ENABLED(FWRETRACT)
static void M207();
static void M208();
static void M209();
#if ENABLED(FWRETRACT_AUTORETRACT)
static void M209();
#endif
#endif
static void M211();

View File

@ -25,7 +25,7 @@
#include "../../Marlin.h"
#if ENABLED(FWRETRACT)
#if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT)
#include "../../feature/fwretract.h"
#endif
@ -54,7 +54,7 @@ void GcodeSuite::G0_G1(
if (IsRunning() && G0_G1_CONDITION) {
get_destination_from_command(); // For X Y Z E F
#if ENABLED(FWRETRACT)
#if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT)
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
// When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves