Browse Source

More explicit EEPROM types (#17127)

Scott Lahteine 4 years ago
parent
commit
112245ee48
No account linked to committer's email address

+ 2
- 2
Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp View File

54
 
54
 
55
 #include "../../inc/MarlinConfig.h"
55
 #include "../../inc/MarlinConfig.h"
56
 
56
 
57
-#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM)
57
+#if ENABLED(FLASH_EEPROM_EMULATION)
58
 
58
 
59
 #include "../shared/Marduino.h"
59
 #include "../shared/Marduino.h"
60
 #include "../shared/persistent_store_api.h"
60
 #include "../shared/persistent_store_api.h"
1016
   ee_Flush();
1016
   ee_Flush();
1017
 }
1017
 }
1018
 
1018
 
1019
-#endif // EEPROM_SETTINGS && (!I2C_EEPROM && !SPI_EEPROM)
1019
+#endif // FLASH_EEPROM_EMULATION
1020
 #endif // ARDUINO_ARCH_AVR
1020
 #endif // ARDUINO_ARCH_AVR

+ 6
- 0
Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h View File

20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
+
24
+#if USE_EMULATED_EEPROM
25
+  #undef SRAM_EEPROM_EMULATION
26
+  #undef SDCARD_EEPROM_EMULATION
27
+  #define FLASH_EEPROM_EMULATION 1
28
+#endif

+ 2
- 2
Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp View File

29
 #include "../../inc/MarlinConfig.h"
29
 #include "../../inc/MarlinConfig.h"
30
 #include "../shared/persistent_store_api.h"
30
 #include "../shared/persistent_store_api.h"
31
 
31
 
32
-#if !defined(E2END) && NONE(I2C_EEPROM, SPI_EEPROM)
32
+#if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION)
33
   #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
33
   #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
34
 #endif
34
 #endif
35
 
35
 
38
 bool PersistentStore::access_start() { return true; }
38
 bool PersistentStore::access_start() { return true; }
39
 
39
 
40
 bool PersistentStore::access_finish() {
40
 bool PersistentStore::access_finish() {
41
-  #if NONE(I2C_EEPROM, SPI_EEPROM)
41
+  #if ENABLED(FLASH_EEPROM_EMULATION)
42
     eeprom_flush();
42
     eeprom_flush();
43
   #endif
43
   #endif
44
   return true;
44
   return true;

+ 8
- 0
Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h View File

20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
+
24
+#if ENABLED(EEPROM_SETTINGS)
25
+  #undef USE_REAL_EEPROM
26
+  #define USE_EMULATED_EEPROM 1
27
+  #if DISABLED(FLASH_EEPROM_EMULATION)
28
+    #define SDCARD_EEPROM_EMULATION 1
29
+  #endif
30
+#endif

+ 1
- 4
Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp View File

38
  */
38
  */
39
 #include "../../inc/MarlinConfigPre.h"
39
 #include "../../inc/MarlinConfigPre.h"
40
 
40
 
41
-#if ENABLED(EEPROM_SETTINGS)
41
+#if ENABLED(FLASH_EEPROM_EMULATION)
42
 
42
 
43
 #include "persistent_store_api.h"
43
 #include "persistent_store_api.h"
44
 #include "../../inc/MarlinConfig.h"
44
 #include "../../inc/MarlinConfig.h"
45
 
45
 
46
-#if ENABLED(FLASH_EEPROM_EMULATION)
47
-
48
 extern "C" {
46
 extern "C" {
49
   #include <lpc17xx_iap.h>
47
   #include <lpc17xx_iap.h>
50
 }
48
 }
128
 size_t PersistentStore::capacity() { return EEPROM_SIZE; }
126
 size_t PersistentStore::capacity() { return EEPROM_SIZE; }
129
 
127
 
130
 #endif // FLASH_EEPROM_EMULATION
128
 #endif // FLASH_EEPROM_EMULATION
131
-#endif // EEPROM_SETTINGS
132
 #endif // TARGET_LPC1768
129
 #endif // TARGET_LPC1768

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

22
  */
22
  */
23
 #ifdef TARGET_LPC1768
23
 #ifdef TARGET_LPC1768
24
 
24
 
25
-#include "../../inc/MarlinConfigPre.h"
25
+#include "../../inc/MarlinConfig.h"
26
 
26
 
27
-#if ENABLED(EEPROM_SETTINGS)
27
+#if ENABLED(SDCARD_EEPROM_EMULATION)
28
 
28
 
29
-#include "../../inc/MarlinConfig.h"
30
 #include "persistent_store_api.h"
29
 #include "persistent_store_api.h"
31
 
30
 
32
-#if DISABLED(FLASH_EEPROM_EMULATION)
33
-
34
 #include <chanfs/diskio.h>
31
 #include <chanfs/diskio.h>
35
 #include <chanfs/ff.h>
32
 #include <chanfs/ff.h>
36
 
33
 
178
 
175
 
179
 size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM
176
 size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM
180
 
177
 
181
-#endif // !FLASH_EEPROM_EMULATION
182
-#endif // EEPROM_SETTINGS
178
+#endif // SDCARD_EEPROM_EMULATION
183
 #endif // TARGET_LPC1768
179
 #endif // TARGET_LPC1768

+ 6
- 0
Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h View File

20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
+
24
+#if USE_EMULATED_EEPROM
25
+  #undef SRAM_EEPROM_EMULATION
26
+  #undef SDCARD_EEPROM_EMULATION
27
+  #define FLASH_EEPROM_EMULATION 1
28
+#endif

+ 1
- 1
Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h View File

23
  * Test SAMD51 specific configuration values for errors at compile-time.
23
  * Test SAMD51 specific configuration values for errors at compile-time.
24
  */
24
  */
25
 
25
 
26
-#if ENABLED(EEPROM_SETTINGS) && NONE(SPI_EEPROM, I2C_EEPROM)
26
+#if ENABLED(FLASH_EEPROM_EMULATION)
27
   #warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Manager/releases"
27
   #warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Manager/releases"
28
 #endif
28
 #endif
29
 
29
 

+ 17
- 17
Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp View File

27
 
27
 
28
 #include "../shared/persistent_store_api.h"
28
 #include "../shared/persistent_store_api.h"
29
 
29
 
30
-#if NONE(SPI_EEPROM, I2C_EEPROM)
30
+#if ENABLED(FLASH_EEPROM_EMULATION)
31
   #define NVMCTRL_CMD(c)    do{                                                 \
31
   #define NVMCTRL_CMD(c)    do{                                                 \
32
                               SYNC(!NVMCTRL->STATUS.bit.READY);                 \
32
                               SYNC(!NVMCTRL->STATUS.bit.READY);                 \
33
                               NVMCTRL->INTFLAG.bit.DONE = true;                 \
33
                               NVMCTRL->INTFLAG.bit.DONE = true;                 \
41
 #endif
41
 #endif
42
 
42
 
43
 bool PersistentStore::access_start() {
43
 bool PersistentStore::access_start() {
44
-  #if NONE(SPI_EEPROM, I2C_EEPROM)
44
+  #if ENABLED(FLASH_EEPROM_EMULATION)
45
     NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED;  // Buffered mode and segment reallocation active
45
     NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED;  // Buffered mode and segment reallocation active
46
   #endif
46
   #endif
47
 
47
 
49
 }
49
 }
50
 
50
 
51
 bool PersistentStore::access_finish() {
51
 bool PersistentStore::access_finish() {
52
-  #if NONE(SPI_EEPROM, I2C_EEPROM)
52
+  #if ENABLED(FLASH_EEPROM_EMULATION)
53
     NVMCTRL_FLUSH();
53
     NVMCTRL_FLUSH();
54
     if (!NVMCTRL->SEESTAT.bit.LOCK)
54
     if (!NVMCTRL->SEESTAT.bit.LOCK)
55
       NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE);    // Lock E2P data write access
55
       NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE);    // Lock E2P data write access
59
 }
59
 }
60
 
60
 
61
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
61
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
62
-  #if NONE(SPI_EEPROM, I2C_EEPROM)
62
+  #if ENABLED(FLASH_EEPROM_EMULATION)
63
     if (NVMCTRL->SEESTAT.bit.RLOCK)
63
     if (NVMCTRL->SEESTAT.bit.RLOCK)
64
       NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE);    // Unlock E2P data write access
64
       NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE);    // Unlock E2P data write access
65
   #endif
65
   #endif
66
 
66
 
67
   while (size--) {
67
   while (size--) {
68
     const uint8_t v = *value;
68
     const uint8_t v = *value;
69
-    #if ANY(SPI_EEPROM, I2C_EEPROM)
69
+    #if ENABLED(FLASH_EEPROM_EMULATION)
70
+      SYNC(NVMCTRL->SEESTAT.bit.BUSY);
71
+      if (NVMCTRL->INTFLAG.bit.SEESFULL)
72
+        NVMCTRL_FLUSH();      // Next write will trigger a sector reallocation. I need to flush 'pagebuffer'
73
+      ((volatile uint8_t *)SEEPROM_ADDR)[pos] = v;
74
+      SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC);
75
+    #else
70
       uint8_t * const p = (uint8_t * const)pos;
76
       uint8_t * const p = (uint8_t * const)pos;
71
       if (v != eeprom_read_byte(p)) {
77
       if (v != eeprom_read_byte(p)) {
72
         eeprom_write_byte(p, v);
78
         eeprom_write_byte(p, v);
76
           return true;
82
           return true;
77
         }
83
         }
78
       }
84
       }
79
-    #else
80
-      SYNC(NVMCTRL->SEESTAT.bit.BUSY);
81
-      if (NVMCTRL->INTFLAG.bit.SEESFULL)
82
-        NVMCTRL_FLUSH();      // Next write will trigger a sector reallocation. I need to flush 'pagebuffer'
83
-      ((volatile uint8_t *)SEEPROM_ADDR)[pos] = v;
84
-      SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC);
85
     #endif
85
     #endif
86
     crc16(crc, &v, 1);
86
     crc16(crc, &v, 1);
87
     pos++;
87
     pos++;
93
 bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
93
 bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
94
   while (size--) {
94
   while (size--) {
95
     uint8_t c;
95
     uint8_t c;
96
-    #if ANY(SPI_EEPROM, I2C_EEPROM)
97
-      c = eeprom_read_byte((uint8_t*)pos);
98
-    #else
96
+    #if ENABLED(FLASH_EEPROM_EMULATION)
99
       SYNC(NVMCTRL->SEESTAT.bit.BUSY);
97
       SYNC(NVMCTRL->SEESTAT.bit.BUSY);
100
       c = ((volatile uint8_t *)SEEPROM_ADDR)[pos];
98
       c = ((volatile uint8_t *)SEEPROM_ADDR)[pos];
99
+    #else
100
+      c = eeprom_read_byte((uint8_t*)pos);
101
     #endif
101
     #endif
102
     if (writing) *value = c;
102
     if (writing) *value = c;
103
     crc16(crc, &c, 1);
103
     crc16(crc, &c, 1);
108
 }
108
 }
109
 
109
 
110
 size_t PersistentStore::capacity() {
110
 size_t PersistentStore::capacity() {
111
-  #if ANY(SPI_EEPROM, I2C_EEPROM)
112
-    return E2END + 1;
113
-  #else
111
+  #if ENABLED(FLASH_EEPROM_EMULATION)
114
     const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
112
     const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
115
                   sblk = NVMCTRL->SEESTAT.bit.SBLK;
113
                   sblk = NVMCTRL->SEESTAT.bit.SBLK;
116
 
114
 
121
     else if (sblk <= 4 || psz == 5) return 16384;
119
     else if (sblk <= 4 || psz == 5) return 16384;
122
     else if (sblk >= 9 && psz == 7) return 65536;
120
     else if (sblk >= 9 && psz == 7) return 65536;
123
     else                            return 32768;
121
     else                            return 32768;
122
+  #else
123
+    return E2END + 1;
124
   #endif
124
   #endif
125
 }
125
 }
126
 
126
 

+ 7
- 7
Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp View File

24
 
24
 
25
 #include "../../inc/MarlinConfig.h"
25
 #include "../../inc/MarlinConfig.h"
26
 
26
 
27
-#if ENABLED(EEPROM_SETTINGS) && ANY(SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
27
+#if EITHER(USE_REAL_EEPROM, SRAM_EEPROM_EMULATION)
28
 
28
 
29
 #include "../shared/persistent_store_api.h"
29
 #include "../shared/persistent_store_api.h"
30
 
30
 
41
     uint8_t v = *value;
41
     uint8_t v = *value;
42
 
42
 
43
     // Save to either external EEPROM, program flash or Backup SRAM
43
     // Save to either external EEPROM, program flash or Backup SRAM
44
-    #if EITHER(SPI_EEPROM, I2C_EEPROM)
44
+    #if USE_REAL_EEPROM
45
       // EEPROM has only ~100,000 write cycles,
45
       // EEPROM has only ~100,000 write cycles,
46
       // so only write bytes that have changed!
46
       // so only write bytes that have changed!
47
       uint8_t * const p = (uint8_t * const)pos;
47
       uint8_t * const p = (uint8_t * const)pos;
68
   do {
68
   do {
69
     // Read from either external EEPROM, program flash or Backup SRAM
69
     // Read from either external EEPROM, program flash or Backup SRAM
70
     const uint8_t c = (
70
     const uint8_t c = (
71
-      #if EITHER(SPI_EEPROM, I2C_EEPROM)
71
+      #if USE_REAL_EEPROM
72
         eeprom_read_byte((uint8_t*)pos)
72
         eeprom_read_byte((uint8_t*)pos)
73
       #else
73
       #else
74
         (*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)))
74
         (*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)))
85
 
85
 
86
 size_t PersistentStore::capacity() {
86
 size_t PersistentStore::capacity() {
87
   return (
87
   return (
88
-    #if ENABLED(SRAM_EEPROM_EMULATION)
89
-      4096 // 4kB
90
-    #else
88
+    #if USE_REAL_EEPROM
91
       E2END + 1
89
       E2END + 1
90
+    #else
91
+      4096 // 4kB
92
     #endif
92
     #endif
93
   );
93
   );
94
 }
94
 }
95
 
95
 
96
-#endif // EEPROM_SETTINGS && (SRAM_EEPROM_EMULATION || SPI_EEPROM || I2C_EEPROM)
96
+#endif // USE_REAL_EEPROM || SRAM_EEPROM_EMULATION
97
 #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
97
 #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC

+ 3
- 3
Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp View File

28
 
28
 
29
 #include "../../inc/MarlinConfig.h"
29
 #include "../../inc/MarlinConfig.h"
30
 
30
 
31
-#if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
31
+#if ENABLED(SDCARD_EEPROM_EMULATION)
32
 
32
 
33
 #include "../shared/persistent_store_api.h"
33
 #include "../shared/persistent_store_api.h"
34
 
34
 
99
 
99
 
100
 size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; }
100
 size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; }
101
 
101
 
102
-#endif // EEPROM_SETTINGS
103
-#endif // STM32
102
+#endif // SDCARD_EEPROM_EMULATION
103
+#endif // STM32 && !STM32GENERIC

+ 2
- 2
Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp View File

22
 
22
 
23
 #include "../../inc/MarlinConfig.h"
23
 #include "../../inc/MarlinConfig.h"
24
 
24
 
25
-#if ENABLED(EEPROM_SETTINGS) && EITHER(SPI_EEPROM, I2C_EEPROM)
25
+#if USE_REAL_EEPROM
26
 
26
 
27
 #include "../shared/persistent_store_api.h"
27
 #include "../shared/persistent_store_api.h"
28
 
28
 
73
 
73
 
74
 size_t PersistentStore::capacity() { return E2END + 1; }
74
 size_t PersistentStore::capacity() { return E2END + 1; }
75
 
75
 
76
-#endif // EEPROM_SETTINGS && EITHER(SPI_EEPROM, I2C_EEPROM)
76
+#endif // USE_REAL_EEPROM
77
 #endif // __STM32F1__
77
 #endif // __STM32F1__

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

29
 
29
 
30
 #include "../../inc/MarlinConfig.h"
30
 #include "../../inc/MarlinConfig.h"
31
 
31
 
32
-#if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
32
+#if ENABLED(SDCARD_EEPROM_EMULATION)
33
 
33
 
34
 #include "../shared/persistent_store_api.h"
34
 #include "../shared/persistent_store_api.h"
35
 
35
 
100
 
100
 
101
 size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; }
101
 size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; }
102
 
102
 
103
-#endif // EEPROM_SETTINGS
103
+#endif // SDCARD_EEPROM_EMULATION
104
 
104
 
105
 #endif // __STM32F1__
105
 #endif // __STM32F1__

+ 2
- 8
Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp View File

27
 // Include configs and pins to get all EEPROM flags
27
 // Include configs and pins to get all EEPROM flags
28
 #include "../../inc/MarlinConfig.h"
28
 #include "../../inc/MarlinConfig.h"
29
 
29
 
30
-#ifdef STM32F7
31
-  #define HAS_EMULATED_EEPROM 1
32
-#else
33
-  #define HAS_EMULATED_EEPROM NONE(I2C_EEPROM, SPI_EEPROM)
34
-#endif
35
-
36
-#if HAS_EMULATED_EEPROM && ENABLED(EEPROM_SETTINGS)
30
+#if ENABLED(FLASH_EEPROM_EMULATION)
37
 
31
 
38
 // ------------------------
32
 // ------------------------
39
 // Includes
33
 // Includes
118
 
112
 
119
 }
113
 }
120
 
114
 
121
-#endif // EEPROM_SETTINGS
115
+#endif // FLASH_EEPROM_EMULATION
122
 #endif // STM32GENERIC && (STM32F4 || STM32F7)
116
 #endif // STM32GENERIC && (STM32F4 || STM32F7)

+ 8
- 0
Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h View File

20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
+
24
+#if ENABLED(EEPROM_SETTINGS) && defined(STM32F7)
25
+  #undef USE_REAL_EEPROM
26
+  #define USE_EMULATED_EEPROM 1
27
+  #undef SRAM_EEPROM_EMULATION
28
+  #undef SDCARD_EEPROM_EMULATION
29
+  #define FLASH_EEPROM_EMULATION 1
30
+#endif

+ 17
- 0
Marlin/src/inc/Conditionals_post.h View File

35
   #define HAS_LINEAR_E_JERK 1
35
   #define HAS_LINEAR_E_JERK 1
36
 #endif
36
 #endif
37
 
37
 
38
+#if ENABLED(EEPROM_SETTINGS)
39
+  #if NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) && EITHER(I2C_EEPROM, SPI_EEPROM)
40
+    #define USE_REAL_EEPROM 1
41
+  #else
42
+    #define USE_EMULATED_EEPROM 1
43
+  #endif
44
+  #if NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
45
+    #define SDCARD_EEPROM_EMULATION 1
46
+  #endif
47
+#else
48
+  #undef I2C_EEPROM
49
+  #undef SPI_EEPROM
50
+  #undef SDCARD_EEPROM_EMULATION
51
+  #undef SRAM_EEPROM_EMULATION
52
+  #undef FLASH_EEPROM_EMULATION
53
+#endif
54
+
38
 #ifdef TEENSYDUINO
55
 #ifdef TEENSYDUINO
39
   #undef max
56
   #undef max
40
   #define max(a,b) ((a)>(b)?(a):(b))
57
   #define max(a,b) ((a)>(b)?(a):(b))

+ 2
- 2
Marlin/src/module/printcounter.h View File

28
 // Print debug messages with M111 S2
28
 // Print debug messages with M111 S2
29
 //#define DEBUG_PRINTCOUNTER
29
 //#define DEBUG_PRINTCOUNTER
30
 
30
 
31
-#if EITHER(I2C_EEPROM, SPI_EEPROM)
31
+#if USE_REAL_EEPROM
32
   // round up address to next page boundary (assuming 32 byte pages)
32
   // round up address to next page boundary (assuming 32 byte pages)
33
   #define STATS_EEPROM_ADDRESS 0x40
33
   #define STATS_EEPROM_ADDRESS 0x40
34
 #else
34
 #else
57
   private:
57
   private:
58
     typedef Stopwatch super;
58
     typedef Stopwatch super;
59
 
59
 
60
-    #if EITHER(I2C_EEPROM, SPI_EEPROM) || defined(CPU_32_BIT)
60
+    #if USE_REAL_EEPROM || defined(CPU_32_BIT)
61
       typedef uint32_t eeprom_address_t;
61
       typedef uint32_t eeprom_address_t;
62
     #else
62
     #else
63
       typedef uint16_t eeprom_address_t;
63
       typedef uint16_t eeprom_address_t;

+ 2
- 2
Marlin/src/sd/cardreader.cpp View File

370
   else {
370
   else {
371
     flag.mounted = true;
371
     flag.mounted = true;
372
     SERIAL_ECHO_MSG(STR_SD_CARD_OK);
372
     SERIAL_ECHO_MSG(STR_SD_CARD_OK);
373
-    #if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
373
+    #if ENABLED(SDCARD_EEPROM_EMULATION)
374
       settings.first_load();
374
       settings.first_load();
375
     #endif
375
     #endif
376
   }
376
   }
622
   if (autostart_index < 0 || flag.sdprinting) return;
622
   if (autostart_index < 0 || flag.sdprinting) return;
623
 
623
 
624
   if (!isMounted()) mount();
624
   if (!isMounted()) mount();
625
-  #if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
625
+  #if ENABLED(SDCARD_EEPROM_EMULATION)
626
     else settings.first_load();
626
     else settings.first_load();
627
   #endif
627
   #endif
628
 
628
 

Loading…
Cancel
Save