Browse Source

Cleaner EEPROM auto init (#13975)

pull/1/head
InsanityAutomation 6 years ago
committed by Scott Lahteine
parent
commit
5108e4b6aa
  1. 10
      Marlin/src/Marlin.cpp
  2. 4
      Marlin/src/module/configuration_store.cpp

10
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

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

Loading…
Cancel
Save