Cleanup, comment "wired" eeproms

This commit is contained in:
Scott Lahteine
2020-04-30 17:33:20 -05:00
parent a521b0edbb
commit 3c080ee3e6
10 changed files with 57 additions and 9 deletions

View File

@@ -25,20 +25,25 @@
#if USE_WIRED_EEPROM
#include "../shared/eeprom_if.h"
/**
* PersistentStore for Arduino-style EEPROM interface
* with implementations supplied by the framework.
*/
#include "../shared/eeprom_api.h"
#ifndef EEPROM_SIZE
#define EEPROM_SIZE 0x8000 // 32kB
#endif
size_t PersistentStore::capacity() { return EEPROM_SIZE; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::access_start() {
TERN_(SPI_EEPROM, eeprom_init());
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--) {
uint8_t v = *value;
@@ -75,7 +80,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
size_t PersistentStore::capacity() { return EEPROM_SIZE; }
#endif // USE_WIRED_EEPROM
#endif // TARGET_LPC1768