🎨 Standardize G-code reporting

This commit is contained in:
Scott Lahteine
2021-09-07 18:06:10 -05:00
committed by Scott Lahteine
parent a596faf4e5
commit 6d96c221bd
48 changed files with 1360 additions and 1170 deletions

View File

@ -30,19 +30,6 @@
#include "../../libs/buzzer.h"
#include "../../MarlinCore.h"
void M206_report() {
SERIAL_ECHOLNPAIR_P(
LIST_N(DOUBLE(LINEAR_AXES),
PSTR("M206 X"), home_offset.x,
SP_Y_STR, home_offset.y,
SP_Z_STR, home_offset.z,
SP_I_STR, home_offset.i,
SP_J_STR, home_offset.j,
SP_K_STR, home_offset.k,
)
);
}
/**
* M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
*
@ -51,6 +38,8 @@ void M206_report() {
* *** In the 2.0 release, it will simply be disabled by default.
*/
void GcodeSuite::M206() {
if (!parser.seen_any()) return M206_report();
LOOP_LINEAR_AXES(i)
if (parser.seen(AXIS_CHAR(i)))
set_home_offset((AxisEnum)i, parser.value_linear_units());
@ -60,10 +49,25 @@ void GcodeSuite::M206() {
if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi
#endif
if (!parser.seen(LINEAR_AXIS_GANG("X", "Y", "Z", "I", "J", "K")))
M206_report();
else
report_current_position();
report_current_position();
}
void GcodeSuite::M206_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, PSTR(STR_HOME_OFFSET));
SERIAL_ECHOLNPAIR_P(
#if IS_CARTESIAN
LIST_N(DOUBLE(LINEAR_AXES),
PSTR(" M206 X"), LINEAR_UNIT(home_offset.x),
SP_Y_STR, LINEAR_UNIT(home_offset.y),
SP_Z_STR, LINEAR_UNIT(home_offset.z),
SP_I_STR, LINEAR_UNIT(home_offset.i),
SP_J_STR, LINEAR_UNIT(home_offset.j),
SP_K_STR, LINEAR_UNIT(home_offset.k)
)
#else
PSTR(" M206 Z"), LINEAR_UNIT(home_offset.z)
#endif
);
}
/**