Encapsulate probe as singleton class (#16751)

This commit is contained in:
Scott Lahteine
2020-02-01 04:21:36 -06:00
committed by GitHub
parent 43d3463d5d
commit 90b6324563
33 changed files with 341 additions and 303 deletions

View File

@@ -39,17 +39,17 @@ void GcodeSuite::M851() {
if (!parser.seen("XYZ")) {
SERIAL_ECHOLNPAIR_P(
#if HAS_PROBE_XY_OFFSET
PSTR(MSG_PROBE_OFFSET " X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR
PSTR(MSG_PROBE_OFFSET " X"), probe.offset_xy.x, SP_Y_STR, probe.offset_xy.y, SP_Z_STR
#else
PSTR(MSG_PROBE_OFFSET " X0 Y0 Z")
#endif
, probe_offset.z
, probe.offset.z
);
return;
}
// Start with current offsets and modify
xyz_pos_t offs = probe_offset;
xyz_pos_t offs = probe.offset;
// Assume no errors
bool ok = true;
@@ -93,7 +93,7 @@ void GcodeSuite::M851() {
}
// Save the new offsets
if (ok) probe_offset = offs;
if (ok) probe.offset = offs;
}
#endif // HAS_BED_PROBE