Browse Source

Patch up M290, M851

Scott Lahteine 7 years ago
parent
commit
be00e421a7
3 changed files with 16 additions and 11 deletions
  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 View File

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

+ 9
- 1
Marlin/src/gcode/motion/M290.cpp View File

29
 #include "../../module/temperature.h"
29
 #include "../../module/temperature.h"
30
 #include "../../module/planner.h"
30
 #include "../../module/planner.h"
31
 
31
 
32
+#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
33
+  #include "../../core/serial.h"
34
+#endif
35
+
32
 /**
36
 /**
33
  * M290: Babystepping
37
  * M290: Babystepping
34
  */
38
  */
39
         const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
43
         const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
40
         thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
44
         thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
41
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
45
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
42
-          zprobe_zoffset += offs;
46
+          if (a == Z_AXIS) zprobe_zoffset += offs;
43
         #endif
47
         #endif
44
       }
48
       }
45
   #else
49
   #else
51
       #endif
55
       #endif
52
     }
56
     }
53
   #endif
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
 #endif // BABYSTEPPING
64
 #endif // BABYSTEPPING

+ 6
- 10
Marlin/src/gcode/probe/M851.cpp View File

30
 
30
 
31
 void GcodeSuite::M851() {
31
 void GcodeSuite::M851() {
32
   SERIAL_ECHO_START();
32
   SERIAL_ECHO_START();
33
-  SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " ");
33
+  SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET);
34
   if (parser.seen('Z')) {
34
   if (parser.seen('Z')) {
35
     const float value = parser.value_linear_units();
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
 #endif // HAS_BED_PROBE
45
 #endif // HAS_BED_PROBE

Loading…
Cancel
Save