update to Bugfix 19/09/2021

This commit is contained in:
pat
2021-09-19 09:45:06 +02:00
parent 8f1a3b19e4
commit 05035ffdba
641 changed files with 30294 additions and 8767 deletions

View File

@@ -32,19 +32,8 @@
* M851: Set the nozzle-to-probe offsets in current units
*/
void GcodeSuite::M851() {
// Show usage with no parameters
if (!parser.seen("XYZ")) {
SERIAL_ECHOLNPAIR_P(
#if HAS_PROBE_XY_OFFSET
PSTR(STR_PROBE_OFFSET " X"), probe.offset_xy.x, SP_Y_STR, probe.offset_xy.y, SP_Z_STR
#else
PSTR(STR_PROBE_OFFSET " X0 Y0 Z")
#endif
, probe.offset.z
);
return;
}
// No parameters? Show current state.
if (!parser.seen("XYZ")) return M851_report();
// Start with current offsets and modify
xyz_pos_t offs = probe.offset;
@@ -58,11 +47,11 @@ void GcodeSuite::M851() {
if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE))
offs.x = x;
else {
SERIAL_ECHOLNPAIR("?X out of range (-", X_BED_SIZE, " to ", X_BED_SIZE, ")");
SERIAL_ECHOLNPGM("?X out of range (-", X_BED_SIZE, " to ", X_BED_SIZE, ")");
ok = false;
}
#else
if (x) SERIAL_ECHOLNPAIR("?X must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
if (x) SERIAL_ECHOLNPGM("?X must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
#endif
}
@@ -72,11 +61,11 @@ void GcodeSuite::M851() {
if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE))
offs.y = y;
else {
SERIAL_ECHOLNPAIR("?Y out of range (-", Y_BED_SIZE, " to ", Y_BED_SIZE, ")");
SERIAL_ECHOLNPGM("?Y out of range (-", Y_BED_SIZE, " to ", Y_BED_SIZE, ")");
ok = false;
}
#else
if (y) SERIAL_ECHOLNPAIR("?Y must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
if (y) SERIAL_ECHOLNPGM("?Y must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
#endif
}
@@ -85,7 +74,7 @@ void GcodeSuite::M851() {
if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
offs.z = z;
else {
SERIAL_ECHOLNPAIR("?Z out of range (", Z_PROBE_OFFSET_RANGE_MIN, " to ", Z_PROBE_OFFSET_RANGE_MAX, ")");
SERIAL_ECHOLNPGM("?Z out of range (", Z_PROBE_OFFSET_RANGE_MIN, " to ", Z_PROBE_OFFSET_RANGE_MAX, ")");
ok = false;
}
}
@@ -94,4 +83,20 @@ void GcodeSuite::M851() {
if (ok) probe.offset = offs;
}
void GcodeSuite::M851_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, PSTR(STR_Z_PROBE_OFFSET));
SERIAL_ECHOPGM_P(
#if HAS_PROBE_XY_OFFSET
PSTR(" M851 X"), LINEAR_UNIT(probe.offset_xy.x),
SP_Y_STR, LINEAR_UNIT(probe.offset_xy.y),
SP_Z_STR
#else
PSTR(" M851 X0 Y0 Z")
#endif
, LINEAR_UNIT(probe.offset.z)
, " ;"
);
say_units();
}
#endif // HAS_BED_PROBE