Match up write_data signatures
This commit is contained in:
parent
2e27e3ba04
commit
18c9182903
@ -61,7 +61,7 @@ bool PersistentStore::access_finish() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||||
std::size_t bytes_written = 0;
|
std::size_t bytes_written = 0;
|
||||||
|
|
||||||
for (std::size_t i = 0; i < size; i++) {
|
for (std::size_t i = 0; i < size; i++) {
|
||||||
|
@ -125,7 +125,7 @@ static void debug_rw(const bool write, int &pos, const uint8_t *value, const siz
|
|||||||
// FR_INVALID_PARAMETER /* (19) Given parameter is invalid */
|
// FR_INVALID_PARAMETER /* (19) Given parameter is invalid */
|
||||||
// } FRESULT;
|
// } FRESULT;
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||||
if (!eeprom_file_open) return true;
|
if (!eeprom_file_open) return true;
|
||||||
FRESULT s;
|
FRESULT s;
|
||||||
UINT bytes_written = 0;
|
UINT bytes_written = 0;
|
||||||
|
@ -80,7 +80,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
|
|||||||
|
|
||||||
#endif // !SDSUPPORT
|
#endif // !SDSUPPORT
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||||
for (size_t i = 0; i < size; i++)
|
for (size_t i = 0; i < size; i++)
|
||||||
HAL_eeprom_data[pos + i] = value[i];
|
HAL_eeprom_data[pos + i] = value[i];
|
||||||
crc16(crc, value, size);
|
crc16(crc, value, size);
|
||||||
|
@ -55,7 +55,7 @@ bool PersistentStore::access_finish() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||||
FLASH_Status status;
|
FLASH_Status status;
|
||||||
|
|
||||||
if (firstWrite) {
|
if (firstWrite) {
|
||||||
|
@ -80,7 +80,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
|
|||||||
|
|
||||||
#endif // !SDSUPPORT
|
#endif // !SDSUPPORT
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||||
for (size_t i = 0; i < size; i++)
|
for (size_t i = 0; i < size; i++)
|
||||||
HAL_eeprom_data[pos + i] = value[i];
|
HAL_eeprom_data[pos + i] = value[i];
|
||||||
crc16(crc, value, size);
|
crc16(crc, value, size);
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user