Browse Source

One fewer G29 error string

pull/1/head
Scott Lahteine 5 years ago
parent
commit
39f1222060
  1. 11
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

11
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

@ -1737,25 +1737,20 @@
* use cases for the users. So we can wait and see what to do with it. * use cases for the users. So we can wait and see what to do with it.
*/ */
void unified_bed_leveling::g29_compare_current_mesh_to_stored_mesh() { void unified_bed_leveling::g29_compare_current_mesh_to_stored_mesh() {
int16_t a = settings.calc_num_meshes(); const int16_t a = settings.calc_num_meshes();
if (!a) { if (!a) {
SERIAL_ECHOLNPGM("?EEPROM storage not available."); SERIAL_ECHOLNPGM("?EEPROM storage not available.");
return; return;
} }
if (!parser.has_value()) { if (!parser.has_value() || !WITHIN(g29_storage_slot, 0, a - 1)) {
SERIAL_ECHOLNPAIR("?Storage slot # required.\n?Use 0 to ", a - 1); SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
return; return;
} }
g29_storage_slot = parser.value_int(); g29_storage_slot = parser.value_int();
if (!WITHIN(g29_storage_slot, 0, a - 1)) {
SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
return;
}
float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
settings.load_mesh(g29_storage_slot, &tmp_z_values); settings.load_mesh(g29_storage_slot, &tmp_z_values);

Loading…
Cancel
Save