Patch up M290, M851

This commit is contained in:
Scott Lahteine
2017-11-25 14:00:39 -06:00
parent d29cb646e3
commit be00e421a7
3 changed files with 16 additions and 11 deletions

View File

@ -30,20 +30,16 @@
void GcodeSuite::M851() {
SERIAL_ECHO_START();
SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " ");
SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET);
if (parser.seen('Z')) {
const float value = parser.value_linear_units();
if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
zprobe_zoffset = value;
SERIAL_ECHO(zprobe_zoffset);
if (!WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
SERIAL_ECHOLNPGM(" " MSG_Z_MIN " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " " MSG_Z_MAX " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX));
return;
}
else
SERIAL_ECHOPGM(MSG_Z_MIN " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " " MSG_Z_MAX " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX));
zprobe_zoffset = value;
}
else
SERIAL_ECHOPAIR(": ", zprobe_zoffset);
SERIAL_EOL();
SERIAL_ECHOLNPAIR(": ", zprobe_zoffset);
}
#endif // HAS_BED_PROBE