Refine EEPROM types / flags (#17772)

This commit is contained in:
Scott Lahteine
2020-04-29 14:46:33 -05:00
committed by GitHub
parent 2d758663db
commit 5e6faa999d
58 changed files with 365 additions and 256 deletions

View File

@ -58,6 +58,8 @@ static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0};
static bool eeprom_dirty = false;
static int current_slot = 0;
size_t PersistentStore::capacity() { return EEPROM_SIZE; }
bool PersistentStore::access_start() {
uint32_t first_nblank_loc, first_nblank_val;
IAP_STATUS_CODE status;
@ -122,7 +124,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false; // return true for any error
}
size_t PersistentStore::capacity() { return EEPROM_SIZE; }
#endif // FLASH_EEPROM_EMULATION
#endif // TARGET_LPC1768

View File

@ -38,6 +38,8 @@ FATFS fat_fs;
FIL eeprom_file;
bool eeprom_file_open = false;
size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM
bool PersistentStore::access_start() {
const char eeprom_erase_value = 0xFF;
MSC_Aquire_Lock();
@ -168,7 +170,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
return bytes_read != size; // return true for any error
}
size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM
#endif // SDCARD_EEPROM_EMULATION
#endif // TARGET_LPC1768

View File

@ -19,19 +19,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* I2C/SPI EEPROM interface for LPC1768
*/
#ifdef TARGET_LPC1768
#include "../../inc/MarlinConfig.h"
#if USE_WIRED_EEPROM
#include "../shared/eeprom_if.h"
#include "../shared/eeprom_api.h"
#include <Wire.h>
#ifndef EEPROM_SIZE
#define EEPROM_SIZE 0x8000 // 32kB

View File

@ -21,8 +21,6 @@
*/
#pragma once
#undef I2C_EEPROM // Arduino framework provides code for I2C
#if USE_FALLBACK_EEPROM
#define FLASH_EEPROM_EMULATION
#endif