Browse Source

[2.0.x] EEPROM code cleanup (#10710)

pull/1/head
Giuliano 6 years ago
committed by Scott Lahteine
parent
commit
d99f1b2245
  1. 11
      Marlin/src/module/configuration_store.cpp
  2. 7
      Marlin/src/module/configuration_store.h

11
Marlin/src/module/configuration_store.cpp

@ -954,7 +954,6 @@ void MarlinSettings::postprocess() {
SERIAL_ECHOPAIR_P(port, "(EEPROM=", stored_ver);
SERIAL_ECHOLNPGM_P(port, " Marlin=" EEPROM_VERSION ")");
#endif
if (!validating) reset();
eeprom_error = true;
}
else {
@ -1511,15 +1510,13 @@ void MarlinSettings::postprocess() {
#endif
}
if (!validating) {
if (eeprom_error) reset(); else postprocess();
}
if (!validating && !eeprom_error) postprocess();
#if ENABLED(AUTO_BED_LEVELING_UBL)
ubl.report_state();
if (!validating) {
if (!ubl.sanity_check()) {
ubl.report_state();
if (!ubl.sanity_check()) {
SERIAL_EOL_P(port);
#if ENABLED(EEPROM_CHITCHAT)
ubl.echo_name();

7
Marlin/src/module/configuration_store.h

@ -45,15 +45,16 @@ class MarlinSettings {
static bool save(PORTINIT_SOLO); // Return 'true' if data was saved
FORCE_INLINE static bool init_eeprom() {
bool success = true;
reset();
#if ENABLED(EEPROM_SETTINGS)
success = save();
const bool success = save();
#if ENABLED(EEPROM_CHITCHAT)
if (success) report();
#endif
return success;
#else
return true;
#endif
return success;
}
#if ENABLED(EEPROM_SETTINGS)

Loading…
Cancel
Save