Przeglądaj źródła

M851 - report only without parameters

Scott Lahteine 7 lat temu
rodzic
commit
bf9fc8ac0e
1 zmienionych plików z 9 dodań i 7 usunięć
  1. 9
    7
      Marlin/src/gcode/probe/M851.cpp

+ 9
- 7
Marlin/src/gcode/probe/M851.cpp Wyświetl plik

@@ -29,16 +29,18 @@
29 29
 #include "../../module/probe.h"
30 30
 
31 31
 void GcodeSuite::M851() {
32
-  SERIAL_ECHO_START();
33
-  SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET);
34
-  if (parser.seen('Z')) {
32
+  if (parser.seenval('Z')) {
35 33
     const float value = parser.value_linear_units();
36
-    if (!WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
37
-      SERIAL_ECHOLNPGM(" " MSG_Z_MIN " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " " MSG_Z_MAX " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX));
38
-      return;
34
+    if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
35
+      zprobe_zoffset = value;
36
+    else {
37
+      SERIAL_ERROR_START();
38
+      SERIAL_ERRORLNPGM("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")");
39 39
     }
40
-    zprobe_zoffset = value;
40
+    return;
41 41
   }
42
+  SERIAL_ECHO_START();
43
+  SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET);
42 44
   SERIAL_ECHOLNPAIR(": ", zprobe_zoffset);
43 45
 }
44 46
 

Ładowanie…
Anuluj
Zapisz