|
@@ -5904,20 +5904,17 @@ inline void gcode_M410() { stepper.quick_stop(); }
|
5904
|
5904
|
* Use either 'M421 X<mm> Y<mm> Z<mm>' or 'M421 I<xindex> J<yindex> Z<mm>'
|
5905
|
5905
|
*/
|
5906
|
5906
|
inline void gcode_M421() {
|
5907
|
|
- float x = 0, y = 0, z = 0;
|
5908
|
|
- int8_t px = 0, py = 0;
|
5909
|
|
- bool err = false, hasX, hasY, hasZ, hasI, hasJ;
|
5910
|
|
- if ((hasX = code_seen('X'))) x = code_value();
|
5911
|
|
- if ((hasY = code_seen('Y'))) y = code_value();
|
5912
|
|
- if ((hasZ = code_seen('Z'))) z = code_value();
|
|
5907
|
+ int8_t px, py;
|
|
5908
|
+ float z = 0;
|
|
5909
|
+ bool hasX, hasY, hasZ, hasI, hasJ;
|
|
5910
|
+ if ((hasX = code_seen('X'))) px = mbl.probe_index_x(code_value());
|
|
5911
|
+ if ((hasY = code_seen('Y'))) py = mbl.probe_index_y(code_value());
|
5913
|
5912
|
if ((hasI = code_seen('I'))) px = code_value();
|
5914
|
5913
|
if ((hasJ = code_seen('J'))) py = code_value();
|
|
5914
|
+ if ((hasZ = code_seen('Z'))) z = code_value();
|
5915
|
5915
|
|
5916
|
5916
|
if (hasX && hasY && hasZ) {
|
5917
|
5917
|
|
5918
|
|
- px = mbl.probe_index_x(x);
|
5919
|
|
- py = mbl.probe_index_y(y);
|
5920
|
|
-
|
5921
|
5918
|
if (px >= 0 && py >= 0)
|
5922
|
5919
|
mbl.set_z(px, py, z);
|
5923
|
5920
|
else {
|
|
@@ -5935,7 +5932,7 @@ inline void gcode_M410() { stepper.quick_stop(); }
|
5935
|
5932
|
}
|
5936
|
5933
|
else {
|
5937
|
5934
|
SERIAL_ERROR_START;
|
5938
|
|
- SERIAL_ERRORLNPGM(MSG_ERR_M421_REQUIRES_XYZ);
|
|
5935
|
+ SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
|
5939
|
5936
|
}
|
5940
|
5937
|
}
|
5941
|
5938
|
|