|
@@ -178,7 +178,7 @@
|
178
|
178
|
* M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
|
179
|
179
|
* M410 - Quickstop. Abort all planned moves.
|
180
|
180
|
* M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
|
181
|
|
- * M421 - Set a single Z coordinate in the Mesh Leveling grid. X<units> Y<units> Z<units> (Requires MESH_BED_LEVELING)
|
|
181
|
+ * M421 - Set a single Z coordinate in the Mesh Leveling grid. X<units> Y<units> Z<units> (Requires MESH_BED_LEVELING or AUTO_BED_LEVELING_UBL)
|
182
|
182
|
* M428 - Set the home_offset based on the current_position. Nearest edge applies.
|
183
|
183
|
* M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
|
184
|
184
|
* M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
|
|
@@ -7557,8 +7557,7 @@ void quickstop_stepper() {
|
7557
|
7557
|
}
|
7558
|
7558
|
#endif
|
7559
|
7559
|
|
7560
|
|
-#if ENABLED(MESH_BED_LEVELING)
|
7561
|
|
-
|
|
7560
|
+#if ENABLED(MESH_BED_LEVELING)
|
7562
|
7561
|
/**
|
7563
|
7562
|
* M421: Set a single Mesh Bed Leveling Z coordinate
|
7564
|
7563
|
* Use either 'M421 X<linear> Y<linear> Z<linear>' or 'M421 I<xindex> J<yindex> Z<linear>'
|
|
@@ -7628,7 +7627,34 @@ void quickstop_stepper() {
|
7628
|
7627
|
SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
|
7629
|
7628
|
}
|
7630
|
7629
|
}
|
|
7630
|
+#elif ENABLED(AUTO_BED_LEVELING_UBL)
|
|
7631
|
+ /**
|
|
7632
|
+ * M421: Set a single Mesh Bed Leveling Z coordinate
|
|
7633
|
+ *
|
|
7634
|
+ * M421 I<xindex> J<yindex> Z<linear>
|
|
7635
|
+ */
|
|
7636
|
+ inline void gcode_M421() {
|
|
7637
|
+ int8_t px = 0, py = 0;
|
|
7638
|
+ float z = 0;
|
|
7639
|
+ bool hasI, hasJ, hasZ;
|
|
7640
|
+ if ((hasI = code_seen('I'))) px = code_value_axis_units(X_AXIS);
|
|
7641
|
+ if ((hasJ = code_seen('J'))) py = code_value_axis_units(Y_AXIS);
|
|
7642
|
+ if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS);
|
7631
|
7643
|
|
|
7644
|
+ if (hasI && hasJ && hasZ) {
|
|
7645
|
+ if (WITHIN(px, 0, UBL_MESH_NUM_Y_POINTS - 1) && WITHIN(py, 0, UBL_MESH_NUM_Y_POINTS - 1)) {
|
|
7646
|
+ ubl.z_values[px][py] = z;
|
|
7647
|
+ }
|
|
7648
|
+ else {
|
|
7649
|
+ SERIAL_ERROR_START;
|
|
7650
|
+ SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY);
|
|
7651
|
+ }
|
|
7652
|
+ }
|
|
7653
|
+ else {
|
|
7654
|
+ SERIAL_ERROR_START;
|
|
7655
|
+ SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
|
|
7656
|
+ }
|
|
7657
|
+ }
|
7632
|
7658
|
#endif
|
7633
|
7659
|
|
7634
|
7660
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
@@ -9387,7 +9413,7 @@ void process_next_command() {
|
9387
|
9413
|
break;
|
9388
|
9414
|
#endif
|
9389
|
9415
|
|
9390
|
|
- #if ENABLED(MESH_BED_LEVELING)
|
|
9416
|
+ #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
9391
|
9417
|
case 421: // M421: Set a Mesh Bed Leveling Z coordinate
|
9392
|
9418
|
gcode_M421();
|
9393
|
9419
|
break;
|