|
@@ -493,7 +493,7 @@ void GcodeSuite::M422() {
|
493
|
493
|
return;
|
494
|
494
|
}
|
495
|
495
|
|
496
|
|
- xy_pos_t *pos_dest = (
|
|
496
|
+ xy_pos_t * const pos_dest = (
|
497
|
497
|
TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !is_probe_point ? z_stepper_align.stepper_xy :)
|
498
|
498
|
z_stepper_align.xy
|
499
|
499
|
);
|
|
@@ -504,24 +504,25 @@ void GcodeSuite::M422() {
|
504
|
504
|
}
|
505
|
505
|
|
506
|
506
|
// Get the Probe Position Index or Z Stepper Index
|
507
|
|
- int8_t position_index;
|
508
|
|
- if (is_probe_point) {
|
509
|
|
- position_index = parser.intval('S') - 1;
|
510
|
|
- if (!WITHIN(position_index, 0, int8_t(NUM_Z_STEPPER_DRIVERS) - 1)) {
|
511
|
|
- SERIAL_ECHOLNPGM("?(S) Probe-position index invalid.");
|
512
|
|
- return;
|
513
|
|
- }
|
514
|
|
- }
|
|
507
|
+ int8_t position_index = 1;
|
|
508
|
+ FSTR_P err_string = F("?(S) Probe-position");
|
|
509
|
+ if (is_probe_point)
|
|
510
|
+ position_index = parser.intval('S');
|
515
|
511
|
else {
|
516
|
512
|
#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
|
517
|
|
- position_index = parser.intval('W') - 1;
|
518
|
|
- if (!WITHIN(position_index, 0, NUM_Z_STEPPER_DRIVERS - 1)) {
|
519
|
|
- SERIAL_ECHOLNPGM("?(W) Z-stepper index invalid.");
|
520
|
|
- return;
|
521
|
|
- }
|
|
513
|
+ err_string = F("?(W) Z-stepper");
|
|
514
|
+ position_index = parser.intval('W');
|
522
|
515
|
#endif
|
523
|
516
|
}
|
524
|
517
|
|
|
518
|
+ if (!WITHIN(position_index, 1, NUM_Z_STEPPER_DRIVERS)) {
|
|
519
|
+ SERIAL_ECHOF(err_string);
|
|
520
|
+ SERIAL_ECHOLNPGM(" index invalid (1.." STRINGIFY(NUM_Z_STEPPER_DRIVERS) ").");
|
|
521
|
+ return;
|
|
522
|
+ }
|
|
523
|
+
|
|
524
|
+ --position_index;
|
|
525
|
+
|
525
|
526
|
const xy_pos_t pos = {
|
526
|
527
|
parser.floatval('X', pos_dest[position_index].x),
|
527
|
528
|
parser.floatval('Y', pos_dest[position_index].y)
|