Cleaner EEPROM auto init (#13975)

2.0.x
InsanityAutomation 6 years ago committed by Scott Lahteine
parent 456a0ee76b
commit 5108e4b6aa

@ -955,15 +955,7 @@ void setup() {
// Load data from EEPROM if available (or use defaults) // Load data from EEPROM if available (or use defaults)
// This also updates variables in the planner, elsewhere // This also updates variables in the planner, elsewhere
#if ENABLED(EEPROM_AUTO_INIT) (void)settings.load();
if (!settings.load()) {
(void)settings.reset();
(void)settings.save();
SERIAL_ECHO_MSG("EEPROM Initialized");
}
#else
(void)settings.load();
#endif
#if HAS_M206_COMMAND #if HAS_M206_COMMAND
// Initialize current position based on home_offset // Initialize current position based on home_offset

@ -2071,6 +2071,10 @@ void MarlinSettings::postprocess() {
return success; return success;
} }
reset(); reset();
#if ENABLED(EEPROM_AUTO_INIT)
(void)save();
SERIAL_ECHO_MSG("EEPROM Initialized");
#endif
return true; return true;
} }

Loading…
Cancel
Save