1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 12:04:19 +00:00

Cleaner EEPROM auto init (#13975)

This commit is contained in:
InsanityAutomation 2019-05-11 17:54:03 -04:00 committed by Scott Lahteine
parent 456a0ee76b
commit 5108e4b6aa
2 changed files with 5 additions and 9 deletions

View File

@ -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

View File

@ -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;
}