From 02a79cc030ac25a610800bddd6a48f83becde086 Mon Sep 17 00:00:00 2001 From: Giuliano <3684609+GMagician@users.noreply.github.com> Date: Sat, 12 May 2018 01:06:36 +0200 Subject: [PATCH] [1.1.x] EEPROM code cleanup (#10711) --- Marlin/configuration_store.cpp | 9 +++------ Marlin/configuration_store.h | 7 ++++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 02a89df2b..b78b53aa5 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -968,7 +968,6 @@ void MarlinSettings::postprocess() { SERIAL_ECHOPAIR("(EEPROM=", stored_ver); SERIAL_ECHOLNPGM(" Marlin=" EEPROM_VERSION ")"); #endif - if (!validating) reset(); eeprom_error = true; } else { @@ -1523,14 +1522,12 @@ 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) { + ubl.report_state(); + if (!ubl.sanity_check()) { SERIAL_EOL(); #if ENABLED(EEPROM_CHITCHAT) diff --git a/Marlin/configuration_store.h b/Marlin/configuration_store.h index 1f0a33c59..2bba57930 100644 --- a/Marlin/configuration_store.h +++ b/Marlin/configuration_store.h @@ -35,15 +35,16 @@ class MarlinSettings { static bool save(); // 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)