UBL G29 works without settings.load

This commit is contained in:
Scott Lahteine 2018-01-04 20:58:09 -06:00
parent 3d34dddbc0
commit fbda8a2e2b
4 changed files with 15 additions and 31 deletions

View file

@ -341,10 +341,6 @@ void MarlinSettings::postprocess() {
bool MarlinSettings::eeprom_error, MarlinSettings::validating;
#if ENABLED(AUTO_BED_LEVELING_UBL)
int16_t MarlinSettings::meshes_begin;
#endif
void MarlinSettings::write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
if (eeprom_error) { pos += size; return; }
while (size--) {
@ -1364,9 +1360,6 @@ void MarlinSettings::postprocess() {
}
#if ENABLED(AUTO_BED_LEVELING_UBL)
meshes_begin = (eeprom_index + 32) & 0xFFF8; // Pad the end of configuration data so it
// can float up or down a little bit without
// disrupting the mesh data
ubl.report_state();
if (!validating) {
@ -1434,12 +1427,13 @@ void MarlinSettings::postprocess() {
}
#endif
int16_t MarlinSettings::meshes_start_index() {
return (datasize() + EEPROM_OFFSET + 32) & 0xFFF8; // Pad the end of configuration data so it can float up
// or down a little bit without disrupting the mesh data
}
uint16_t MarlinSettings::calc_num_meshes() {
//obviously this will get more sophisticated once we've added an actual MAT
if (meshes_begin <= 0) return 0;
return (meshes_end - meshes_begin) / sizeof(ubl.z_values);
return (meshes_end - meshes_start_index()) / sizeof(ubl.z_values);
}
void MarlinSettings::store_mesh(const int8_t slot) {