Procházet zdrojové kódy

Settings FIELD_TEST fix

Scott Lahteine před 7 roky
rodič
revize
702c8acdd5
1 změnil soubory, kde provedl 6 přidání a 6 odebrání
  1. 6
    6
      Marlin/src/module/configuration_store.cpp

+ 6
- 6
Marlin/src/module/configuration_store.cpp Zobrazit soubor

@@ -330,10 +330,10 @@ void MarlinSettings::postprocess() {
330 330
   #define EEPROM_ASSERT(TST,ERR) if (!(TST)) do{ SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(ERR); eeprom_error = true; }while(0)
331 331
 
332 332
   #if ENABLED(DEBUG_EEPROM_READWRITE)
333
-    #define _FIELD_TEST(FIELD)                                          \
334
-      EEPROM_ASSERT(                                                    \
335
-        eeprom_error || eeprom_index == offsetof(SettingsData, FIELD),  \
336
-        "Field " STRINGIFY(FIELD) " mismatch."                          \
333
+    #define _FIELD_TEST(FIELD) \
334
+      EEPROM_ASSERT( \
335
+        eeprom_error || eeprom_index == offsetof(SettingsData, FIELD) + EEPROM_OFFSET, \
336
+        "Field " STRINGIFY(FIELD) " mismatch." \
337 337
       )
338 338
   #else
339 339
     #define _FIELD_TEST(FIELD) NOOP
@@ -357,7 +357,7 @@ void MarlinSettings::postprocess() {
357 357
    */
358 358
   bool MarlinSettings::save() {
359 359
     float dummy = 0.0f;
360
-    char ver[4] = "000";
360
+    char ver[4] = "ERR";
361 361
 
362 362
     uint16_t working_crc = 0;
363 363
 
@@ -840,7 +840,7 @@ void MarlinSettings::postprocess() {
840 840
 
841 841
     // Version has to match or defaults are used
842 842
     if (strncmp(version, stored_ver, 3) != 0) {
843
-      if (stored_ver[0] != 'V') {
843
+      if (stored_ver[3] != '\0') {
844 844
         stored_ver[0] = '?';
845 845
         stored_ver[1] = '\0';
846 846
       }

Loading…
Zrušit
Uložit