|
@@ -320,7 +320,6 @@ void GcodeSuite::G34() {
|
320
|
320
|
};
|
321
|
321
|
|
322
|
322
|
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
323
|
|
-
|
324
|
323
|
// Check if the applied corrections go in the correct direction.
|
325
|
324
|
// Calculate the sum of the absolute deviations from the mean of the probe measurements.
|
326
|
325
|
// Compare to the last iteration to ensure it's getting better.
|
|
@@ -478,32 +477,18 @@ void GcodeSuite::M422() {
|
478
|
477
|
|
479
|
478
|
const bool is_probe_point = parser.seen('S');
|
480
|
479
|
|
481
|
|
- #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
482
|
|
- if (is_probe_point && parser.seen('W')) {
|
483
|
|
- SERIAL_ECHOLNPGM("?(S) and (W) may not be combined.");
|
484
|
|
- return;
|
485
|
|
- }
|
486
|
|
- #endif
|
|
480
|
+ if (TERN0(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, is_probe_point && parser.seen('W'))) {
|
|
481
|
+ SERIAL_ECHOLNPGM("?(S) and (W) may not be combined.");
|
|
482
|
+ return;
|
|
483
|
+ }
|
487
|
484
|
|
488
|
485
|
xy_pos_t *pos_dest = (
|
489
|
|
- #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
490
|
|
- !is_probe_point ? z_stepper_align.stepper_xy :
|
491
|
|
- #endif
|
|
486
|
+ TERN_(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, !is_probe_point ? z_stepper_align.stepper_xy :)
|
492
|
487
|
z_stepper_align.xy
|
493
|
488
|
);
|
494
|
489
|
|
495
|
|
- if (!is_probe_point
|
496
|
|
- #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
497
|
|
- && !parser.seen('W')
|
498
|
|
- #endif
|
499
|
|
- ) {
|
500
|
|
- SERIAL_ECHOLNPGM(
|
501
|
|
- #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
502
|
|
- "?(S) or (W) is required."
|
503
|
|
- #else
|
504
|
|
- "?(S) is required."
|
505
|
|
- #endif
|
506
|
|
- );
|
|
490
|
+ if (!is_probe_point && TERN1(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, !parser.seen('W'))) {
|
|
491
|
+ SERIAL_ECHOLNPGM("?(S)" TERN_(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, " or (W)") " is required.");
|
507
|
492
|
return;
|
508
|
493
|
}
|
509
|
494
|
|
|
@@ -512,7 +497,7 @@ void GcodeSuite::M422() {
|
512
|
497
|
if (is_probe_point) {
|
513
|
498
|
position_index = parser.intval('S') - 1;
|
514
|
499
|
if (!WITHIN(position_index, 0, int8_t(NUM_Z_STEPPER_DRIVERS) - 1)) {
|
515
|
|
- SERIAL_ECHOLNPGM("?(S) Z-ProbePosition index invalid.");
|
|
500
|
+ SERIAL_ECHOLNPGM("?(S) Probe-position index invalid.");
|
516
|
501
|
return;
|
517
|
502
|
}
|
518
|
503
|
}
|
|
@@ -520,7 +505,7 @@ void GcodeSuite::M422() {
|
520
|
505
|
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
521
|
506
|
position_index = parser.intval('W') - 1;
|
522
|
507
|
if (!WITHIN(position_index, 0, NUM_Z_STEPPER_DRIVERS - 1)) {
|
523
|
|
- SERIAL_ECHOLNPGM("?(W) Z-Stepper index invalid.");
|
|
508
|
+ SERIAL_ECHOLNPGM("?(W) Z-stepper index invalid.");
|
524
|
509
|
return;
|
525
|
510
|
}
|
526
|
511
|
#endif
|