🎨 Standardize G-code reporting
This commit is contained in:
@@ -36,38 +36,6 @@
|
||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
#include "../../core/debug_out.h"
|
||||
|
||||
void M666_report(const bool forReplay=true) {
|
||||
if (!forReplay) { SERIAL_ECHOLNPGM("; Endstop adjustment:"); SERIAL_ECHO_START(); }
|
||||
#if ENABLED(DELTA)
|
||||
SERIAL_ECHOLNPAIR_P(
|
||||
PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a)
|
||||
, SP_Y_STR, LINEAR_UNIT(delta_endstop_adj.b)
|
||||
, SP_Z_STR, LINEAR_UNIT(delta_endstop_adj.c)
|
||||
);
|
||||
#else
|
||||
SERIAL_ECHOPGM(" M666");
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, LINEAR_UNIT(endstops.x2_endstop_adj));
|
||||
#endif
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, LINEAR_UNIT(endstops.y2_endstop_adj));
|
||||
#endif
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
SERIAL_ECHOPAIR(" S2 Z", LINEAR_UNIT(endstops.z3_endstop_adj));
|
||||
if (!forReplay) SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR(" M666 S3 Z", LINEAR_UNIT(endstops.z3_endstop_adj));
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
if (!forReplay) SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR(" M666 S4 Z", LINEAR_UNIT(endstops.z4_endstop_adj));
|
||||
#endif
|
||||
#else
|
||||
SERIAL_ECHOLNPAIR_P(SP_Z_STR, LINEAR_UNIT(endstops.z2_endstop_adj));
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(DELTA)
|
||||
|
||||
/**
|
||||
@@ -92,6 +60,15 @@ void M666_report(const bool forReplay=true) {
|
||||
if (!is_set) M666_report();
|
||||
}
|
||||
|
||||
void GcodeSuite::M666_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, PSTR(STR_ENDSTOP_ADJUSTMENT));
|
||||
SERIAL_ECHOLNPAIR_P(
|
||||
PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a)
|
||||
, SP_Y_STR, LINEAR_UNIT(delta_endstop_adj.b)
|
||||
, SP_Z_STR, LINEAR_UNIT(delta_endstop_adj.c)
|
||||
);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/**
|
||||
@@ -105,6 +82,8 @@ void M666_report(const bool forReplay=true) {
|
||||
* Set All: M666 Z<offset>
|
||||
*/
|
||||
void GcodeSuite::M666() {
|
||||
if (!parser.seen_any()) return M666_report();
|
||||
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
if (parser.seenval('X')) endstops.x2_endstop_adj = parser.value_linear_units();
|
||||
#endif
|
||||
@@ -123,7 +102,30 @@ void M666_report(const bool forReplay=true) {
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
if (!parser.seen("XYZ")) M666_report();
|
||||
}
|
||||
|
||||
void GcodeSuite::M666_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, PSTR(STR_ENDSTOP_ADJUSTMENT));
|
||||
SERIAL_ECHOPGM(" M666");
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, LINEAR_UNIT(endstops.x2_endstop_adj));
|
||||
#endif
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, LINEAR_UNIT(endstops.y2_endstop_adj));
|
||||
#endif
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
SERIAL_ECHOPAIR(" S2 Z", LINEAR_UNIT(endstops.z3_endstop_adj));
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOPAIR(" M666 S3 Z", LINEAR_UNIT(endstops.z3_endstop_adj));
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOPAIR(" M666 S4 Z", LINEAR_UNIT(endstops.z4_endstop_adj));
|
||||
#endif
|
||||
#else
|
||||
SERIAL_ECHOLNPAIR_P(SP_Z_STR, LINEAR_UNIT(endstops.z2_endstop_adj));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // HAS_EXTRA_ENDSTOPS
|
||||
|
||||
Reference in New Issue
Block a user