diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cbeb9a091..61a4baa41 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -188,7 +188,7 @@ * M407 - Display measured filament diameter * M410 - Quickstop. Abort all the planned moves * M420 - Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable - * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z + * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z * M500 - Store parameters in EEPROM * M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily). * M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. @@ -4467,16 +4467,15 @@ inline void gcode_M410() { quickStop(); } * M421: Set a single Mesh Bed Leveling Z coordinate */ inline void gcode_M421() { - int x, y; - float z; + float x, y, z; bool err = false, hasX, hasY, hasZ; - if ((hasX = code_seen('X'))) x = code_value_short(); - if ((hasY = code_seen('Y'))) y = code_value_short(); + if ((hasX = code_seen('X'))) x = code_value(); + if ((hasY = code_seen('Y'))) y = code_value(); if ((hasZ = code_seen('Z'))) z = code_value(); if (!hasX || !hasY || !hasZ) { SERIAL_ERROR_START; - SERIAL_ERRORLNPGM(MSG_ERR_XYZ_REQUIRED_FOR_M421); + SERIAL_ERRORLNPGM(MSG_ERR_M421_REQUIRES_XYZ); err = true; } @@ -4486,7 +4485,7 @@ inline void gcode_M410() { quickStop(); } err = true; } - if (!err) mbl.z_values[y][x] = z; + if (!err) mbl.set_z(select_x_index(x), select_y_index(y), z); } #endif diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 0cd7faa7c..782b5d320 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -96,8 +96,8 @@ #include "configuration_store.h" #ifdef MESH_BED_LEVELING - #include "mesh_bed_leveling.h" -#endif // MESH_BED_LEVELING + #include "mesh_bed_leveling.h" +#endif void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) { uint8_t c; @@ -168,9 +168,7 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, mesh_num_x); EEPROM_WRITE_VAR(i, mesh_num_y); dummy = 0.0f; - for (int q=0; q out of range (0-1)" -#define MSG_ERR_XYZ_REQUIRED_FOR_M421 "M421 requires XYZ parameters" +#define MSG_ERR_M421_REQUIRES_XYZ "M421 requires XYZ parameters" #define MSG_ERR_MESH_INDEX_OOB "Mesh XY index is out of bounds" #define MSG_M119_REPORT "Reporting endstop status" #define MSG_ENDSTOP_HIT "TRIGGERED" diff --git a/Marlin/language.h b/Marlin/language.h index b6beb4747..d8ceafb1a 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -159,7 +159,7 @@ #define MSG_Z2_MAX "z2_max: " #define MSG_Z_PROBE "z_probe: " #define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" -#define MSG_ERR_XYZ_REQUIRED_FOR_M421 "M421 requires XYZ parameters" +#define MSG_ERR_M421_REQUIRES_XYZ "M421 requires XYZ parameters" #define MSG_ERR_MESH_INDEX_OOB "Mesh XY index is out of bounds" #define MSG_M119_REPORT "Reporting endstop status" #define MSG_ENDSTOP_HIT "TRIGGERED"