Browse Source

Patches for M290, M851

Scott Lahteine 7 years ago
parent
commit
b2d3fffe74
2 changed files with 12 additions and 11 deletions
  1. 11
    11
      Marlin/Marlin_main.cpp
  2. 1
    0
      Marlin/language.h

+ 11
- 11
Marlin/Marlin_main.cpp View File

@@ -9338,7 +9338,7 @@ inline void gcode_M226() {
9338 9338
           const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
9339 9339
           thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
9340 9340
           #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9341
-            zprobe_zoffset += offs;
9341
+            if (a == Z_AXIS) zprobe_zoffset += offs;
9342 9342
           #endif
9343 9343
         }
9344 9344
     #else
@@ -9350,6 +9350,10 @@ inline void gcode_M226() {
9350 9350
         #endif
9351 9351
       }
9352 9352
     #endif
9353
+    #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9354
+      SERIAL_ECHO_START();
9355
+      SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset);
9356
+    #endif
9353 9357
   }
9354 9358
 
9355 9359
 #endif // BABYSTEPPING
@@ -10053,20 +10057,16 @@ inline void gcode_M502() {
10053 10057
 
10054 10058
   inline void gcode_M851() {
10055 10059
     SERIAL_ECHO_START();
10056
-    SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " ");
10060
+    SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET);
10057 10061
     if (parser.seen('Z')) {
10058 10062
       const float value = parser.value_linear_units();
10059
-      if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
10060
-        zprobe_zoffset = value;
10061
-        SERIAL_ECHO(zprobe_zoffset);
10063
+      if (!WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
10064
+        SERIAL_ECHOLNPGM(" " MSG_Z_MIN " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " " MSG_Z_MAX " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX));
10065
+        return;
10062 10066
       }
10063
-      else
10064
-        SERIAL_ECHOPGM(MSG_Z_MIN " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " " MSG_Z_MAX " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX));
10067
+      zprobe_zoffset = value;
10065 10068
     }
10066
-    else
10067
-      SERIAL_ECHOPAIR(": ", zprobe_zoffset);
10068
-
10069
-    SERIAL_EOL();
10069
+    SERIAL_ECHOLNPAIR(": ", zprobe_zoffset);
10070 10070
   }
10071 10071
 
10072 10072
 #endif // HAS_BED_PROBE

+ 1
- 0
Marlin/language.h View File

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

Loading…
Cancel
Save