EEPROM M500 block size check for reading stored data added
This commit is contained in:
parent
d8dc2eef7a
commit
740e922b87
1 changed files with 12 additions and 2 deletions
|
@ -354,8 +354,18 @@ bool Config_RetrieveSettings(uint16_t offset)
|
||||||
|
|
||||||
// Call updatePID (similar to when we have processed M301)
|
// Call updatePID (similar to when we have processed M301)
|
||||||
updatePID();
|
updatePID();
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLNPGM("Stored settings retrieved");
|
if (EEPROM_M500_SIZE + EEPROM_OFFSET == i) {
|
||||||
|
SERIAL_ECHO_START;
|
||||||
|
SERIAL_ECHOLNPGM("Stored settings retrieved");
|
||||||
|
|
||||||
|
}
|
||||||
|
else { //size of eeprom M500 section probably changed by mistake and data are not valid; default values will be used
|
||||||
|
puts_P(PSTR("Data read from EEPROM not valid."));
|
||||||
|
Config_ResetDefault();
|
||||||
|
previous_settings_retrieved = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue