Pārlūkot izejas kodu

Get E2END from pins, fix Linux buffer

Scott Lahteine 5 gadus atpakaļ
vecāks
revīzija
3ae3bf5d33

+ 1
- 1
Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp Parādīt failu

@@ -29,7 +29,7 @@
29 29
 #include "../../inc/MarlinConfig.h"
30 30
 #include "../shared/persistent_store_api.h"
31 31
 
32
-#if NONE(I2C_EEPROM, SPI_EEPROM)
32
+#if !defined(E2END) && NONE(I2C_EEPROM, SPI_EEPROM)
33 33
   #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
34 34
 #endif
35 35
 

+ 0
- 2
Marlin/src/HAL/HAL_LINUX/include/Arduino.h Parādīt failu

@@ -43,8 +43,6 @@
43 43
 #define FALLING      0x03
44 44
 #define RISING       0x04
45 45
 
46
-#define E2END 0xFFF // EEPROM end address
47
-
48 46
 typedef uint8_t byte;
49 47
 #define PROGMEM
50 48
 #define PSTR(v) (v)

+ 4
- 3
Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp Parādīt failu

@@ -29,7 +29,8 @@
29 29
 #include "../shared/persistent_store_api.h"
30 30
 #include <stdio.h>
31 31
 
32
-uint8_t buffer[E2END];
32
+#define LINUX_EEPROM_SIZE (E2END + 1)
33
+uint8_t buffer[LINUX_EEPROM_SIZE];
33 34
 char filename[] = "eeprom.dat";
34 35
 
35 36
 bool PersistentStore::access_start() {
@@ -40,8 +41,8 @@ bool PersistentStore::access_start() {
40 41
   fseek(eeprom_file, 0L, SEEK_END);
41 42
   std::size_t file_size = ftell(eeprom_file);
42 43
 
43
-  if (file_size < E2END) {
44
-    memset(buffer + file_size, eeprom_erase_value, E2END - file_size);
44
+  if (file_size < LINUX_EEPROM_SIZE) {
45
+    memset(buffer + file_size, eeprom_erase_value, LINUX_EEPROM_SIZE - file_size);
45 46
   }
46 47
   else {
47 48
     fseek(eeprom_file, 0L, SEEK_SET);

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp Parādīt failu

@@ -33,7 +33,7 @@
33 33
 #include "../shared/persistent_store_api.h"
34 34
 
35 35
 #ifndef E2END
36
-  #define E2END 4095
36
+  #define E2END 0xFFF // 4KB
37 37
 #endif
38 38
 #define HAL_STM32F1_EEPROM_SIZE (E2END + 1)
39 39
 

+ 2
- 2
Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.h Parādīt failu

@@ -71,11 +71,11 @@
71 71
 
72 72
 /* Pages 0 and 1 base and end addresses */
73 73
 #define PAGE0_BASE_ADDRESS    ((uint32_t)(EEPROM_START_ADDRESS + 0x0000))
74
-#define PAGE0_END_ADDRESS     ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1)))
74
+#define PAGE0_END_ADDRESS     ((uint32_t)(EEPROM_START_ADDRESS + PAGE_SIZE - 1))
75 75
 #define PAGE0_ID               FLASH_SECTOR_1
76 76
 
77 77
 #define PAGE1_BASE_ADDRESS    ((uint32_t)(EEPROM_START_ADDRESS + 0x4000))
78
-#define PAGE1_END_ADDRESS     ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1)))
78
+#define PAGE1_END_ADDRESS     ((uint32_t)(EEPROM_START_ADDRESS + 2 * (PAGE_SIZE) - 1))
79 79
 #define PAGE1_ID               FLASH_SECTOR_2
80 80
 
81 81
 /* Used Flash pages for EEPROM emulation */

+ 1
- 2
Marlin/src/pins/pins_ARMED.h Parādīt failu

@@ -32,8 +32,7 @@
32 32
 
33 33
 #define I2C_EEPROM
34 34
 
35
-#undef E2END
36
-#define E2END 0xFFF // EEPROM end address (4kB)
35
+#define E2END 0xFFF // 4KB
37 36
 
38 37
 #if HOTENDS > 2 || E_STEPPERS > 2
39 38
   #error "Arm'ed supports up to 2 hotends / E-steppers."

+ 1
- 1
Marlin/src/pins/pins_BLACK_STM32F407VE.h Parādīt failu

@@ -40,7 +40,7 @@
40 40
 #define DEFAULT_MACHINE_NAME "STM32F407VET6"
41 41
 
42 42
 //#define I2C_EEPROM
43
-//#define E2END 0x1FFF // EEPROM end address (8kB)
43
+//#define E2END 0x1FFF // 8KB
44 44
 #define SRAM_EEPROM_EMULATION
45 45
 
46 46
 #if HOTENDS > 2 || E_STEPPERS > 2

+ 2
- 2
Marlin/src/pins/pins_GTM32_PRO_VB.h Parādīt failu

@@ -53,7 +53,7 @@
53 53
 
54 54
 // Enable EEPROM Emulation for this board as it doesn't have EEPROM
55 55
 #define FLASH_EEPROM_EMULATION
56
-#define E2END 0xFFF // EEPROM end address (4kB)
56
+#define E2END 0xFFF // 4KB
57 57
 
58 58
 //
59 59
 // Limit Switches
@@ -224,7 +224,7 @@
224 224
 #endif
225 225
 
226 226
 #define SDSS               SS_PIN
227
- 
227
+
228 228
 //
229 229
 // ESP WiFi can be soldered to J9 connector which is wired to USART2.
230 230
 // Must define WIFISUPPORT in Configuration.h for the printer.

+ 4
- 4
Marlin/src/pins/pins_JGAURORA_A5S_A1.h Parādīt failu

@@ -41,14 +41,14 @@
41 41
 
42 42
 //#define MCU_STM32F103ZE // not yet required
43 43
 
44
-// // I2C EEPROM with 64K of space - AT24C64
45
-// #define I2C_EEPROM
46
-// #define E2END 0x7FFF
44
+// #define I2C_EEPROM   // AT24C64
45
+// #define E2END 0x7FFF // 64KB
47 46
 
48 47
 // Enable EEPROM Emulation for this board
49 48
 
50 49
 //#define FLASH_EEPROM_EMULATION 1
51
-//#define E2END  0xFFF //((uint32)(EEPROM_START_ADDRESS + EEPROM_PAGE_SIZE + EEPROM_PAGE_SIZE)) // not 0xFFF
50
+//#define E2END 0xFFF // 4KB
51
+//#define E2END uint32(EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE * 2) - 1)
52 52
 //#define EEPROM_CHITCHAT
53 53
 //#define DEBUG_EEPROM_READWRITE
54 54
 

+ 1
- 2
Marlin/src/pins/pins_RADDS.h Parādīt failu

@@ -201,9 +201,8 @@
201 201
   #define FIL_RUNOUT_PIN   39   // SERVO2_PIN
202 202
 #endif
203 203
 
204
-// I2C EEPROM with 8K of space
205 204
 #define I2C_EEPROM
206
-#define E2END 0x1FFF
205
+#define E2END 0x1FFF // 8KB
207 206
 
208 207
 //
209 208
 // LCD / Controller

+ 2
- 0
Marlin/src/pins/pins_RAMPS_LINUX.h Parādīt failu

@@ -49,6 +49,8 @@
49 49
   #define BOARD_NAME "RAMPS 1.4"
50 50
 #endif
51 51
 
52
+#define E2END 0xFFF // 4KB
53
+
52 54
 #define IS_RAMPS_EFB
53 55
 
54 56
 //

+ 1
- 2
Marlin/src/pins/pins_RUMBA32.h Parādīt failu

@@ -30,8 +30,7 @@
30 30
 #define DEFAULT_MACHINE_NAME BOARD_NAME
31 31
 
32 32
 //#define I2C_EEPROM
33
-
34
-#define E2END 0xFFF // EEPROM end address (4kB)
33
+#define E2END 0xFFF // 4KB
35 34
 
36 35
 #if HOTENDS > 3 || E_STEPPERS > 3
37 36
   #error "RUMBA32 supports up to 3 hotends / E-steppers."

+ 1
- 1
Marlin/src/pins/pins_STM32F4.h Parādīt failu

@@ -30,7 +30,7 @@
30 30
 
31 31
 //#define I2C_EEPROM
32 32
 
33
-#define E2END 0xFFF // EEPROM end address (4kB)
33
+#define E2END 0xFFF // 4KB
34 34
 
35 35
 // Ignore temp readings during develpment.
36 36
 //#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE

Notiek ielāde…
Atcelt
Saglabāt