瀏覽代碼

Cleanup, comment "wired" eeproms

Scott Lahteine 5 年之前
父節點
當前提交
3c080ee3e6

+ 5
- 0
Marlin/src/HAL/AVR/eeprom.cpp 查看文件

25
 
25
 
26
 #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
26
 #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
27
 
27
 
28
+/**
29
+ * PersistentStore for Arduino-style EEPROM interface
30
+ * with implementations supplied by the framework.
31
+ */
32
+
28
 #include "../shared/eeprom_api.h"
33
 #include "../shared/eeprom_api.h"
29
 
34
 
30
 size_t PersistentStore::capacity()    { return E2END + 1; }
35
 size_t PersistentStore::capacity()    { return E2END + 1; }

+ 5
- 0
Marlin/src/HAL/DUE/eeprom_wired.cpp 查看文件

26
 
26
 
27
 #if USE_WIRED_EEPROM
27
 #if USE_WIRED_EEPROM
28
 
28
 
29
+/**
30
+ * PersistentStore for Arduino-style EEPROM interface
31
+ * with simple implementations supplied by Marlin.
32
+ */
33
+
29
 #include "../shared/eeprom_if.h"
34
 #include "../shared/eeprom_if.h"
30
 #include "../shared/eeprom_api.h"
35
 #include "../shared/eeprom_api.h"
31
 
36
 

+ 8
- 5
Marlin/src/HAL/LPC1768/eeprom_wired.cpp 查看文件

25
 
25
 
26
 #if USE_WIRED_EEPROM
26
 #if USE_WIRED_EEPROM
27
 
27
 
28
-#include "../shared/eeprom_if.h"
28
+/**
29
+ * PersistentStore for Arduino-style EEPROM interface
30
+ * with implementations supplied by the framework.
31
+ */
32
+
29
 #include "../shared/eeprom_api.h"
33
 #include "../shared/eeprom_api.h"
30
 
34
 
31
 #ifndef EEPROM_SIZE
35
 #ifndef EEPROM_SIZE
32
   #define EEPROM_SIZE           0x8000 // 32kB‬
36
   #define EEPROM_SIZE           0x8000 // 32kB‬
33
 #endif
37
 #endif
34
 
38
 
39
+size_t PersistentStore::capacity()    { return EEPROM_SIZE; }
40
+bool PersistentStore::access_finish() { return true; }
41
+
35
 bool PersistentStore::access_start() {
42
 bool PersistentStore::access_start() {
36
   TERN_(SPI_EEPROM, eeprom_init());
43
   TERN_(SPI_EEPROM, eeprom_init());
37
   return true;
44
   return true;
38
 }
45
 }
39
 
46
 
40
-bool PersistentStore::access_finish() { return true; }
41
-
42
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
47
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
43
   while (size--) {
48
   while (size--) {
44
     uint8_t v = *value;
49
     uint8_t v = *value;
75
   return false;
80
   return false;
76
 }
81
 }
77
 
82
 
78
-size_t PersistentStore::capacity() { return EEPROM_SIZE; }
79
-
80
 #endif // USE_WIRED_EEPROM
83
 #endif // USE_WIRED_EEPROM
81
 #endif // TARGET_LPC1768
84
 #endif // TARGET_LPC1768

+ 5
- 0
Marlin/src/HAL/SAMD51/eeprom_wired.cpp 查看文件

24
 
24
 
25
 #if USE_WIRED_EEPROM
25
 #if USE_WIRED_EEPROM
26
 
26
 
27
+/**
28
+ * PersistentStore for Arduino-style EEPROM interface
29
+ * with simple implementations supplied by Marlin.
30
+ */
31
+
27
 #include "../shared/eeprom_if.h"
32
 #include "../shared/eeprom_if.h"
28
 #include "../shared/eeprom_api.h"
33
 #include "../shared/eeprom_api.h"
29
 
34
 

+ 8
- 1
Marlin/src/HAL/STM32/eeprom_wired.cpp 查看文件

26
 
26
 
27
 #if USE_WIRED_EEPROM
27
 #if USE_WIRED_EEPROM
28
 
28
 
29
+/**
30
+ * PersistentStore for Arduino-style EEPROM interface
31
+ * with simple implementations supplied by Marlin.
32
+ */
29
 
33
 
30
 #include "../shared/eeprom_if.h"
34
 #include "../shared/eeprom_if.h"
31
 #include "../shared/eeprom_api.h"
35
 #include "../shared/eeprom_api.h"
32
 
36
 
33
 size_t PersistentStore::capacity()    { return E2END + 1; }
37
 size_t PersistentStore::capacity()    { return E2END + 1; }
34
-bool PersistentStore::access_start()  { return true; }
35
 bool PersistentStore::access_finish() { return true; }
38
 bool PersistentStore::access_finish() { return true; }
36
 
39
 
40
+bool PersistentStore::access_start()  {
41
+  return true;
42
+}
43
+
37
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
44
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
38
   while (size--) {
45
   while (size--) {
39
     uint8_t v = *value;
46
     uint8_t v = *value;

+ 5
- 0
Marlin/src/HAL/STM32F1/eeprom_wired.cpp 查看文件

23
 
23
 
24
 #if USE_WIRED_EEPROM
24
 #if USE_WIRED_EEPROM
25
 
25
 
26
+/**
27
+ * PersistentStore for Arduino-style EEPROM interface
28
+ * with simple implementations supplied by Marlin.
29
+ */
30
+
26
 #include "../shared/eeprom_if.h"
31
 #include "../shared/eeprom_if.h"
27
 #include "../shared/eeprom_api.h"
32
 #include "../shared/eeprom_api.h"
28
 
33
 

Marlin/src/HAL/STM32_F4_F7/eeprom.cpp → Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp 查看文件

24
 
24
 
25
 #include "../../inc/MarlinConfig.h"
25
 #include "../../inc/MarlinConfig.h"
26
 
26
 
27
-#if ENABLED(EEPROM_SETTINGS)
27
+#if USE_WIRED_EEPROM
28
+
29
+/**
30
+ * PersistentStore for Arduino-style EEPROM interface
31
+ * with simple implementations supplied by Marlin.
32
+ */
28
 
33
 
29
 #include "../shared/eeprom_if.h"
34
 #include "../shared/eeprom_if.h"
30
 #include "../shared/eeprom_api.h"
35
 #include "../shared/eeprom_api.h"
33
 bool PersistentStore::access_start()  { return true; }
38
 bool PersistentStore::access_start()  { return true; }
34
 bool PersistentStore::access_finish() { return true; }
39
 bool PersistentStore::access_finish() { return true; }
35
 
40
 
41
+bool PersistentStore::access_start()  {
42
+  return true;
43
+}
44
+
36
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
45
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
37
   while (size--) {
46
   while (size--) {
38
     uint8_t * const p = (uint8_t * const)pos;
47
     uint8_t * const p = (uint8_t * const)pos;
64
   return false;
73
   return false;
65
 }
74
 }
66
 
75
 
67
-#endif // EEPROM_SETTINGS
76
+#endif // USE_WIRED_EEPROM
68
 #endif // STM32GENERIC && (STM32F4 || STM32F7)
77
 #endif // STM32GENERIC && (STM32F4 || STM32F7)

+ 0
- 1
Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h 查看文件

26
   #undef SRAM_EEPROM_EMULATION
26
   #undef SRAM_EEPROM_EMULATION
27
   #undef SDCARD_EEPROM_EMULATION
27
   #undef SDCARD_EEPROM_EMULATION
28
   #define FLASH_EEPROM_EMULATION
28
   #define FLASH_EEPROM_EMULATION
29
-  #warning "Forcing use of FLASH_EEPROM_EMULATION."
30
 #endif
29
 #endif

+ 5
- 0
Marlin/src/HAL/TEENSY31_32/eeprom.cpp 查看文件

22
 
22
 
23
 #if USE_WIRED_EEPROM
23
 #if USE_WIRED_EEPROM
24
 
24
 
25
+/**
26
+ * PersistentStore for Arduino-style EEPROM interface
27
+ * with implementations supplied by the framework.
28
+ */
29
+
25
 #include "../shared/eeprom_api.h"
30
 #include "../shared/eeprom_api.h"
26
 
31
 
27
 bool PersistentStore::access_start() { return true; }
32
 bool PersistentStore::access_start() { return true; }

+ 5
- 0
Marlin/src/HAL/TEENSY35_36/eeprom.cpp 查看文件

26
 
26
 
27
 #if USE_WIRED_EEPROM
27
 #if USE_WIRED_EEPROM
28
 
28
 
29
+/**
30
+ * PersistentStore for Arduino-style EEPROM interface
31
+ * with implementations supplied by the framework.
32
+ */
33
+
29
 #include "../shared/eeprom_api.h"
34
 #include "../shared/eeprom_api.h"
30
 #include <avr/eeprom.h>
35
 #include <avr/eeprom.h>
31
 
36
 

Loading…
取消
儲存