Add M207/8/9 reporting (#21335)

This commit is contained in:
Scott Lahteine
2021-03-12 09:25:41 -06:00
committed by GitHub
parent 604c5dedf4
commit 7f1fa0d1ff
5 changed files with 98 additions and 54 deletions

View File

@ -29,46 +29,24 @@
/**
* 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 GcodeSuite::M207() {
if (parser.seen('S')) fwretract.settings.retract_length = parser.value_axis_units(E_AXIS);
if (parser.seen('F')) fwretract.settings.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
if (parser.seen('Z')) fwretract.settings.retract_zraise = parser.value_linear_units();
if (parser.seen('W')) fwretract.settings.swap_retract_length = parser.value_axis_units(E_AXIS);
}
void GcodeSuite::M207() { fwretract.M207(); }
/**
* 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 GcodeSuite::M208() {
if (parser.seen('S')) fwretract.settings.retract_recover_extra = parser.value_axis_units(E_AXIS);
if (parser.seen('F')) fwretract.settings.retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
if (parser.seen('R')) fwretract.settings.swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
if (parser.seen('W')) fwretract.settings.swap_retract_recover_extra = parser.value_axis_units(E_AXIS);
}
void GcodeSuite::M208() { fwretract.M208(); }
#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.
*
* For slicers that don't support G10/11, reversed
* extruder-only moves can be classified as retraction.
*/
void GcodeSuite::M209() {
if (MIN_AUTORETRACT <= MAX_AUTORETRACT && parser.seen('S'))
fwretract.enable_autoretract(parser.value_bool());
}
void GcodeSuite::M209() { fwretract.M209(); }
#endif // FWRETRACT_AUTORETRACT
#endif
#endif // FWRETRACT

View File

@ -30,7 +30,7 @@
#include "../../libs/buzzer.h"
#include "../../MarlinCore.h"
void m206_report() {
void M206_report() {
SERIAL_ECHOLNPAIR_P(PSTR("M206 X"), home_offset.x, SP_Y_STR, home_offset.y, SP_Z_STR, home_offset.z);
}
@ -52,7 +52,7 @@ void GcodeSuite::M206() {
#endif
if (!parser.seen("XYZ"))
m206_report();
M206_report();
else
report_current_position();
}