Get E2END from pins, fix Linux buffer

This commit is contained in:
Scott Lahteine 2019-07-09 21:26:35 -05:00
parent 01e8813286
commit 3ae3bf5d33
13 changed files with 21 additions and 23 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -71,11 +71,11 @@
/* Pages 0 and 1 base and end addresses */ /* Pages 0 and 1 base and end addresses */
#define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000)) #define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000))
#define PAGE0_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1))) #define PAGE0_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + PAGE_SIZE - 1))
#define PAGE0_ID FLASH_SECTOR_1 #define PAGE0_ID FLASH_SECTOR_1
#define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x4000)) #define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x4000))
#define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1))) #define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 2 * (PAGE_SIZE) - 1))
#define PAGE1_ID FLASH_SECTOR_2 #define PAGE1_ID FLASH_SECTOR_2
/* Used Flash pages for EEPROM emulation */ /* Used Flash pages for EEPROM emulation */

View file

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

View file

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

View file

@ -53,7 +53,7 @@
// Enable EEPROM Emulation for this board as it doesn't have EEPROM // Enable EEPROM Emulation for this board as it doesn't have EEPROM
#define FLASH_EEPROM_EMULATION #define FLASH_EEPROM_EMULATION
#define E2END 0xFFF // EEPROM end address (4kB) #define E2END 0xFFF // 4KB
// //
// Limit Switches // Limit Switches

View file

@ -41,14 +41,14 @@
//#define MCU_STM32F103ZE // not yet required //#define MCU_STM32F103ZE // not yet required
// // I2C EEPROM with 64K of space - AT24C64 // #define I2C_EEPROM // AT24C64
// #define I2C_EEPROM // #define E2END 0x7FFF // 64KB
// #define E2END 0x7FFF
// Enable EEPROM Emulation for this board // Enable EEPROM Emulation for this board
//#define FLASH_EEPROM_EMULATION 1 //#define FLASH_EEPROM_EMULATION 1
//#define E2END 0xFFF //((uint32)(EEPROM_START_ADDRESS + EEPROM_PAGE_SIZE + EEPROM_PAGE_SIZE)) // not 0xFFF //#define E2END 0xFFF // 4KB
//#define E2END uint32(EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE * 2) - 1)
//#define EEPROM_CHITCHAT //#define EEPROM_CHITCHAT
//#define DEBUG_EEPROM_READWRITE //#define DEBUG_EEPROM_READWRITE

View file

@ -201,9 +201,8 @@
#define FIL_RUNOUT_PIN 39 // SERVO2_PIN #define FIL_RUNOUT_PIN 39 // SERVO2_PIN
#endif #endif
// I2C EEPROM with 8K of space
#define I2C_EEPROM #define I2C_EEPROM
#define E2END 0x1FFF #define E2END 0x1FFF // 8KB
// //
// LCD / Controller // LCD / Controller

View file

@ -49,6 +49,8 @@
#define BOARD_NAME "RAMPS 1.4" #define BOARD_NAME "RAMPS 1.4"
#endif #endif
#define E2END 0xFFF // 4KB
#define IS_RAMPS_EFB #define IS_RAMPS_EFB
// //

View file

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

View file

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