General cleanup of config-store, reset_bed_level

This commit is contained in:
Scott Lahteine
2017-12-25 03:32:31 -06:00
parent 2925852244
commit 4b49ea1e92
6 changed files with 61 additions and 65 deletions

View File

@ -173,27 +173,25 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) {
* Reset calibration results to zero.
*/
void reset_bed_level() {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("reset_bed_level");
#endif
set_bed_leveling_enabled(false);
#if ENABLED(MESH_BED_LEVELING)
if (leveling_is_valid()) {
mbl.reset();
mbl.has_mesh = false;
}
#else
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("reset_bed_level");
#endif
#if ABL_PLANAR
planner.bed_level_matrix.set_to_identity();
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] =
bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0;
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
z_values[x][y] = NAN;
#elif ENABLED(AUTO_BED_LEVELING_UBL)
ubl.reset();
#endif
#elif ENABLED(AUTO_BED_LEVELING_UBL)
ubl.reset();
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] =
bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0;
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
z_values[x][y] = NAN;
#elif ABL_PLANAR
planner.bed_level_matrix.set_to_identity();
#endif
}

View File

@ -310,7 +310,8 @@
void unified_bed_leveling::G29() {
if (!settings.calc_num_meshes()) {
SERIAL_PROTOCOLLNPGM("?Enable EEPROM and init with M502, M500.\n");
SERIAL_PROTOCOLLNPGM("?Enable EEPROM and init with");
SERIAL_PROTOCOLLNPGM("M502, M500, M501 in that order.\n");
return;
}
@ -608,7 +609,7 @@
if (parser.seen('L')) { // Load Current Mesh Data
g29_storage_slot = parser.has_value() ? parser.value_int() : storage_slot;
int16_t a = settings.calc_num_meshes();
uint16_t a = settings.calc_num_meshes();
if (!a) {
SERIAL_PROTOCOLLNPGM("?EEPROM storage not available.");
@ -650,7 +651,7 @@
return;
}
int16_t a = settings.calc_num_meshes();
uint16_t a = settings.calc_num_meshes();
if (!a) {
SERIAL_PROTOCOLLNPGM("?EEPROM storage not available.");