Browse Source

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

Scott Lahteine 7 years ago
parent
commit
d18d40e1d6
1 changed files with 11 additions and 6 deletions
  1. 11
    6
      Marlin/src/gcode/motion/M290.cpp

+ 11
- 6
Marlin/src/gcode/motion/M290.cpp View File

33
   #include "../../core/serial.h"
33
   #include "../../core/serial.h"
34
 #endif
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
  * M290: Babystepping
46
  * M290: Babystepping
38
  */
47
  */
43
         const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
52
         const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
44
         thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
53
         thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
45
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
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
         #endif
56
         #endif
48
       }
57
       }
49
   #else
58
   #else
51
       const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
60
       const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
52
       thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]);
61
       thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]);
53
       #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
62
       #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
54
-        zprobe_zoffset += offs;
63
+        if (parser.boolval('P', true)) mod_zprobe_zoffset(offs);
55
       #endif
64
       #endif
56
     }
65
     }
57
   #endif
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
 #endif // BABYSTEPPING
69
 #endif // BABYSTEPPING

Loading…
Cancel
Save