Browse Source

Get E2END from pins, fix Linux buffer

Scott Lahteine 5 years ago
parent
commit
3ae3bf5d33

+ 1
- 1
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 NONE(I2C_EEPROM, SPI_EEPROM)
32
+#if !defined(E2END) && NONE(I2C_EEPROM, SPI_EEPROM)
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
 

+ 0
- 2
Marlin/src/HAL/HAL_LINUX/include/Arduino.h View File

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

+ 4
- 3
Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp View File

29
 #include "../shared/persistent_store_api.h"
29
 #include "../shared/persistent_store_api.h"
30
 #include <stdio.h>
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
 char filename[] = "eeprom.dat";
34
 char filename[] = "eeprom.dat";
34
 
35
 
35
 bool PersistentStore::access_start() {
36
 bool PersistentStore::access_start() {
40
   fseek(eeprom_file, 0L, SEEK_END);
41
   fseek(eeprom_file, 0L, SEEK_END);
41
   std::size_t file_size = ftell(eeprom_file);
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
   else {
47
   else {
47
     fseek(eeprom_file, 0L, SEEK_SET);
48
     fseek(eeprom_file, 0L, SEEK_SET);

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

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

+ 2
- 2
Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.h View File

71
 
71
 
72
 /* Pages 0 and 1 base and end addresses */
72
 /* Pages 0 and 1 base and end addresses */
73
 #define PAGE0_BASE_ADDRESS    ((uint32_t)(EEPROM_START_ADDRESS + 0x0000))
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
 #define PAGE0_ID               FLASH_SECTOR_1
75
 #define PAGE0_ID               FLASH_SECTOR_1
76
 
76
 
77
 #define PAGE1_BASE_ADDRESS    ((uint32_t)(EEPROM_START_ADDRESS + 0x4000))
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
 #define PAGE1_ID               FLASH_SECTOR_2
79
 #define PAGE1_ID               FLASH_SECTOR_2
80
 
80
 
81
 /* Used Flash pages for EEPROM emulation */
81
 /* Used Flash pages for EEPROM emulation */

+ 1
- 2
Marlin/src/pins/pins_ARMED.h View File

32
 
32
 
33
 #define I2C_EEPROM
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
 #if HOTENDS > 2 || E_STEPPERS > 2
37
 #if HOTENDS > 2 || E_STEPPERS > 2
39
   #error "Arm'ed supports up to 2 hotends / E-steppers."
38
   #error "Arm'ed supports up to 2 hotends / E-steppers."

+ 1
- 1
Marlin/src/pins/pins_BLACK_STM32F407VE.h View File

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

+ 2
- 2
Marlin/src/pins/pins_GTM32_PRO_VB.h View File

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

+ 4
- 4
Marlin/src/pins/pins_JGAURORA_A5S_A1.h View File

41
 
41
 
42
 //#define MCU_STM32F103ZE // not yet required
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
 // Enable EEPROM Emulation for this board
47
 // Enable EEPROM Emulation for this board
49
 
48
 
50
 //#define FLASH_EEPROM_EMULATION 1
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
 //#define EEPROM_CHITCHAT
52
 //#define EEPROM_CHITCHAT
53
 //#define DEBUG_EEPROM_READWRITE
53
 //#define DEBUG_EEPROM_READWRITE
54
 
54
 

+ 1
- 2
Marlin/src/pins/pins_RADDS.h View File

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

+ 2
- 0
Marlin/src/pins/pins_RAMPS_LINUX.h View File

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

+ 1
- 2
Marlin/src/pins/pins_RUMBA32.h View File

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

+ 1
- 1
Marlin/src/pins/pins_STM32F4.h View File

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

Loading…
Cancel
Save