|
@@ -5851,19 +5851,22 @@ inline void gcode_M410() { stepper.quick_stop(); }
|
5851
|
5851
|
if ((hasY = code_seen('Y'))) y = code_value();
|
5852
|
5852
|
if ((hasZ = code_seen('Z'))) z = code_value();
|
5853
|
5853
|
|
5854
|
|
- if (!hasX || !hasY || !hasZ) {
|
5855
|
|
- SERIAL_ERROR_START;
|
5856
|
|
- SERIAL_ERRORLNPGM(MSG_ERR_M421_REQUIRES_XYZ);
|
5857
|
|
- err = true;
|
5858
|
|
- }
|
|
5854
|
+ if (hasX && hasY && hasZ) {
|
5859
|
5855
|
|
5860
|
|
- if (x >= MESH_NUM_X_POINTS || y >= MESH_NUM_Y_POINTS) {
|
|
5856
|
+ int8_t ix = mbl.select_x_index(x),
|
|
5857
|
+ iy = mbl.select_y_index(y);
|
|
5858
|
+
|
|
5859
|
+ if (ix >= 0 && iy >= 0)
|
|
5860
|
+ mbl.set_z(ix, iy, z);
|
|
5861
|
+ else {
|
|
5862
|
+ SERIAL_ERROR_START;
|
|
5863
|
+ SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY);
|
|
5864
|
+ }
|
|
5865
|
+ }
|
|
5866
|
+ else {
|
5861
|
5867
|
SERIAL_ERROR_START;
|
5862
|
|
- SERIAL_ERRORLNPGM(MSG_ERR_MESH_INDEX_OOB);
|
5863
|
|
- err = true;
|
|
5868
|
+ SERIAL_ERRORLNPGM(MSG_ERR_M421_REQUIRES_XYZ);
|
5864
|
5869
|
}
|
5865
|
|
-
|
5866
|
|
- if (!err) mbl.set_z(mbl.select_x_index(x), mbl.select_y_index(y), z);
|
5867
|
5870
|
}
|
5868
|
5871
|
|
5869
|
5872
|
#endif
|