|
|
@ -27,7 +27,7 @@
|
|
|
|
bool PersistentStore::access_start() { return true; }
|
|
|
|
bool PersistentStore::access_start() { return true; }
|
|
|
|
bool PersistentStore::access_finish() { return true; }
|
|
|
|
bool PersistentStore::access_finish() { return true; }
|
|
|
|
|
|
|
|
|
|
|
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
|
|
|
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
|
|
|
while (size--) {
|
|
|
|
while (size--) {
|
|
|
|
uint8_t * const p = (uint8_t * const)pos;
|
|
|
|
uint8_t * const p = (uint8_t * const)pos;
|
|
|
|
uint8_t v = *value;
|
|
|
|
uint8_t v = *value;
|
|
|
@ -47,7 +47,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, uint16_t size,
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool PersistentStore::read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) {
|
|
|
|
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
uint8_t c = eeprom_read_byte((uint8_t*)pos);
|
|
|
|
uint8_t c = eeprom_read_byte((uint8_t*)pos);
|
|
|
|
if (writing) *value = c;
|
|
|
|
if (writing) *value = c;
|
|
|
|