Переглянути джерело

M290 report on change, P0 to leave Probe Z Offset alone

Scott Lahteine 7 роки тому
джерело
коміт
d18d40e1d6
1 змінених файлів з 11 додано та 6 видалено
  1. 11
    6
      Marlin/src/gcode/motion/M290.cpp

+ 11
- 6
Marlin/src/gcode/motion/M290.cpp Переглянути файл

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

Завантаження…
Відмінити
Зберегти