From 5108e4b6aaeb0b5143b7b6bf09103e6cdd3be491 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sat, 11 May 2019 17:54:03 -0400 Subject: [PATCH] Cleaner EEPROM auto init (#13975) --- Marlin/src/Marlin.cpp | 10 +--------- Marlin/src/module/configuration_store.cpp | 4 ++++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index e82911da4..6f9e52783 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -955,15 +955,7 @@ void setup() { // Load data from EEPROM if available (or use defaults) // This also updates variables in the planner, elsewhere - #if ENABLED(EEPROM_AUTO_INIT) - if (!settings.load()) { - (void)settings.reset(); - (void)settings.save(); - SERIAL_ECHO_MSG("EEPROM Initialized"); - } - #else - (void)settings.load(); - #endif + (void)settings.load(); #if HAS_M206_COMMAND // Initialize current position based on home_offset diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 7742710bd..50d5214ff 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -2071,6 +2071,10 @@ void MarlinSettings::postprocess() { return success; } reset(); + #if ENABLED(EEPROM_AUTO_INIT) + (void)save(); + SERIAL_ECHO_MSG("EEPROM Initialized"); + #endif return true; }