Browse Source

HAL_STM32F1_EEPROM_SIZE => HAL_EEPROM_SIZE

Scott Lahteine 6 years ago
parent
commit
e1942715ce
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp

+ 7
- 7
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp View File

36
 #ifndef E2END
36
 #ifndef E2END
37
   #define E2END 0xFFF // 4KB
37
   #define E2END 0xFFF // 4KB
38
 #endif
38
 #endif
39
-#define HAL_STM32F1_EEPROM_SIZE (E2END + 1)
39
+#define HAL_EEPROM_SIZE (E2END + 1)
40
 
40
 
41
 #define _ALIGN(x) __attribute__ ((aligned(x))) // SDIO uint32_t* compat.
41
 #define _ALIGN(x) __attribute__ ((aligned(x))) // SDIO uint32_t* compat.
42
-static char _ALIGN(4) HAL_eeprom_data[HAL_STM32F1_EEPROM_SIZE];
42
+static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
43
 
43
 
44
 #if ENABLED(SDSUPPORT)
44
 #if ENABLED(SDSUPPORT)
45
 
45
 
54
     if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
54
     if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
55
       return false;
55
       return false;
56
 
56
 
57
-    int bytes_read = file.read(HAL_eeprom_data, HAL_STM32F1_EEPROM_SIZE);
57
+    int bytes_read = file.read(HAL_eeprom_data, HAL_EEPROM_SIZE);
58
     if (bytes_read < 0) return false;
58
     if (bytes_read < 0) return false;
59
-    for (; bytes_read < HAL_STM32F1_EEPROM_SIZE; bytes_read++)
59
+    for (; bytes_read < HAL_EEPROM_SIZE; bytes_read++)
60
       HAL_eeprom_data[bytes_read] = 0xFF;
60
       HAL_eeprom_data[bytes_read] = 0xFF;
61
     file.close();
61
     file.close();
62
     return true;
62
     return true;
68
     SdFile file, root = card.getroot();
68
     SdFile file, root = card.getroot();
69
     int bytes_written = 0;
69
     int bytes_written = 0;
70
     if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
70
     if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
71
-      bytes_written = file.write(HAL_eeprom_data, HAL_STM32F1_EEPROM_SIZE);
71
+      bytes_written = file.write(HAL_eeprom_data, HAL_EEPROM_SIZE);
72
       file.close();
72
       file.close();
73
     }
73
     }
74
-    return (bytes_written == HAL_STM32F1_EEPROM_SIZE);
74
+    return (bytes_written == HAL_EEPROM_SIZE);
75
   }
75
   }
76
 
76
 
77
 #else // !SDSUPPORT
77
 #else // !SDSUPPORT
98
   return false;
98
   return false;
99
 }
99
 }
100
 
100
 
101
-size_t PersistentStore::capacity() { return HAL_STM32F1_EEPROM_SIZE; }
101
+size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; }
102
 
102
 
103
 #endif // EEPROM_SETTINGS
103
 #endif // EEPROM_SETTINGS
104
 
104
 

Loading…
Cancel
Save