Browse Source

Add error-check to M422

Scott Lahteine 5 years ago
parent
commit
cd3ec5a77b
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      Marlin/src/gcode/calibrate/G34_M422.cpp

+ 15
- 0
Marlin/src/gcode/calibrate/G34_M422.cpp View File

@@ -386,6 +386,21 @@ void GcodeSuite::M422() {
386 386
     z_auto_align_pos
387 387
   );
388 388
 
389
+  if (!is_probe_point
390
+    #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
391
+      && !parser.seen('W')
392
+    #endif
393
+  ) {
394
+    SERIAL_ECHOLNPGM(
395
+      #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
396
+        "?(S) or (W) is required."
397
+      #else
398
+        "?(S) is required."
399
+      #endif
400
+    );
401
+    return;
402
+  }
403
+
389 404
   // Get the Probe Position Index or Z Stepper Index
390 405
   int8_t position_index;
391 406
   if (is_probe_point) {

Loading…
Cancel
Save