Cleaner EEPROM auto init (#13975)
This commit is contained in:
parent
456a0ee76b
commit
5108e4b6aa
2 changed files with 5 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue