Explorar el Código

Patch up M290, M851

Scott Lahteine hace 7 años
padre
commit
be00e421a7
Se han modificado 3 ficheros con 16 adiciones y 11 borrados
  1. 1
    0
      Marlin/src/core/language.h
  2. 9
    1
      Marlin/src/gcode/motion/M290.cpp
  3. 6
    10
      Marlin/src/gcode/probe/M851.cpp

+ 1
- 0
Marlin/src/core/language.h Ver fichero

@@ -162,6 +162,7 @@
162 162
 #define MSG_Z2_MIN                          "z2_min: "
163 163
 #define MSG_Z2_MAX                          "z2_max: "
164 164
 #define MSG_Z_PROBE                         "z_probe: "
165
+#define MSG_PROBE_Z_OFFSET                  "Probe Z Offset"
165 166
 #define MSG_FILAMENT_RUNOUT_SENSOR          "filament: "
166 167
 #define MSG_ERR_MATERIAL_INDEX              "M145 S<index> out of range (0-1)"
167 168
 #define MSG_ERR_M355_NONE                   "No case light"

+ 9
- 1
Marlin/src/gcode/motion/M290.cpp Ver fichero

@@ -29,6 +29,10 @@
29 29
 #include "../../module/temperature.h"
30 30
 #include "../../module/planner.h"
31 31
 
32
+#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
33
+  #include "../../core/serial.h"
34
+#endif
35
+
32 36
 /**
33 37
  * M290: Babystepping
34 38
  */
@@ -39,7 +43,7 @@ void GcodeSuite::M290() {
39 43
         const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
40 44
         thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
41 45
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
42
-          zprobe_zoffset += offs;
46
+          if (a == Z_AXIS) zprobe_zoffset += offs;
43 47
         #endif
44 48
       }
45 49
   #else
@@ -51,6 +55,10 @@ void GcodeSuite::M290() {
51 55
       #endif
52 56
     }
53 57
   #endif
58
+  #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
59
+    SERIAL_ECHO_START();
60
+    SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset);
61
+  #endif
54 62
 }
55 63
 
56 64
 #endif // BABYSTEPPING

+ 6
- 10
Marlin/src/gcode/probe/M851.cpp Ver fichero

@@ -30,20 +30,16 @@
30 30
 
31 31
 void GcodeSuite::M851() {
32 32
   SERIAL_ECHO_START();
33
-  SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " ");
33
+  SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET);
34 34
   if (parser.seen('Z')) {
35 35
     const float value = parser.value_linear_units();
36
-    if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
37
-      zprobe_zoffset = value;
38
-      SERIAL_ECHO(zprobe_zoffset);
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;
39 39
     }
40
-    else
41
-      SERIAL_ECHOPGM(MSG_Z_MIN " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " " MSG_Z_MAX " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX));
40
+    zprobe_zoffset = value;
42 41
   }
43
-  else
44
-    SERIAL_ECHOPAIR(": ", zprobe_zoffset);
45
-
46
-  SERIAL_EOL();
42
+  SERIAL_ECHOLNPAIR(": ", zprobe_zoffset);
47 43
 }
48 44
 
49 45
 #endif // HAS_BED_PROBE

Loading…
Cancelar
Guardar