LPC176x SPI / I2C PersistentStore (#17651)

This commit is contained in:
randellhodges
2020-04-28 02:27:55 -05:00
committed by GitHub
parent 7c3909bc3f
commit 5f7a75979f
29 changed files with 132 additions and 210 deletions

View File

@ -28,13 +28,8 @@
#include "../shared/eeprom_api.h"
bool PersistentStore::access_start() {
return true;
}
bool PersistentStore::access_finish() {
return true;
}
bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
@ -84,13 +79,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
}
size_t PersistentStore::capacity() {
return (
#if USE_WIRED_EEPROM
E2END + 1
#else
4096 // 4kB
#endif
);
return TERN(USE_WIRED_EEPROM, E2END + 1, 4096); // 4K for emulated
}
#endif // USE_WIRED_EEPROM || SRAM_EEPROM_EMULATION

View File

@ -21,7 +21,7 @@
*/
#pragma once
// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
// If no real or emulated EEPROM selected, fall back to SD emulation
#if USE_FALLBACK_EEPROM
#define SDCARD_EEPROM_EMULATION
#endif