Browse Source

Cleaner EEPROM auto init (#13975)

InsanityAutomation 5 years ago
parent
commit
5108e4b6aa
2 changed files with 5 additions and 9 deletions
  1. 1
    9
      Marlin/src/Marlin.cpp
  2. 4
    0
      Marlin/src/module/configuration_store.cpp

+ 1
- 9
Marlin/src/Marlin.cpp View File

@@ -955,15 +955,7 @@ void setup() {
955 955
 
956 956
   // Load data from EEPROM if available (or use defaults)
957 957
   // This also updates variables in the planner, elsewhere
958
-  #if ENABLED(EEPROM_AUTO_INIT)
959
-    if (!settings.load()) {
960
-      (void)settings.reset();
961
-      (void)settings.save();
962
-      SERIAL_ECHO_MSG("EEPROM Initialized");
963
-    }
964
-  #else
965
-    (void)settings.load();
966
-  #endif
958
+  (void)settings.load();
967 959
 
968 960
   #if HAS_M206_COMMAND
969 961
     // Initialize current position based on home_offset

+ 4
- 0
Marlin/src/module/configuration_store.cpp View File

@@ -2071,6 +2071,10 @@ void MarlinSettings::postprocess() {
2071 2071
       return success;
2072 2072
     }
2073 2073
     reset();
2074
+    #if ENABLED(EEPROM_AUTO_INIT)
2075
+      (void)save();
2076
+      SERIAL_ECHO_MSG("EEPROM Initialized");
2077
+    #endif
2074 2078
     return true;
2075 2079
   }
2076 2080
 

Loading…
Cancel
Save