Skip to content

Commit

Permalink
Extra comments to clarify EEPROM code
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jun 30, 2016
1 parent 787f394 commit 6b2a7b3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Marlin/configuration_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, mesh_num_y);
EEPROM_WRITE_VAR(i, mbl.z_values);
#else
// For disabled MBL write a default mesh
uint8_t mesh_num_x = 3,
mesh_num_y = 3,
dummy_uint8 = 0;
Expand All @@ -242,6 +243,7 @@ void Config_StoreSettings() {
#endif
EEPROM_WRITE_VAR(i, zprobe_zoffset);

// 9 floats for DELTA / Z_DUAL_ENDSTOPS
#if ENABLED(DELTA)
EEPROM_WRITE_VAR(i, endstop_adj); // 3 floats
EEPROM_WRITE_VAR(i, delta_radius); // 1 float
Expand Down Expand Up @@ -409,12 +411,16 @@ void Config_RetrieveSettings() {
mbl.status = dummy_uint8;
mbl.z_offset = dummy;
if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) {
// EEPROM data fits the current mesh
EEPROM_READ_VAR(i, mbl.z_values);
} else {
}
else {
// EEPROM data is stale
mbl.reset();
for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
}
#else
// MBL is disabled - skip the stored data
for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
#endif // MESH_BED_LEVELING

Expand Down

0 comments on commit 6b2a7b3

Please sign in to comment.