Revert errant const

This commit is contained in:
Scott Lahteine 2019-09-28 23:51:04 -05:00
parent 7c5e6900e1
commit f2d93f61c3
10 changed files with 10 additions and 10 deletions

View file

@ -44,7 +44,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) {
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;

View file

@ -72,7 +72,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) {
if (!eeprom_file.seek(pos)) return true; // return true for any error if (!eeprom_file.seek(pos)) return true; // return true for any error
if (eeprom_file.write(value, size) != size) return true; if (eeprom_file.write(value, size) != size) return true;

View file

@ -109,7 +109,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) {
for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i]; for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i];
eeprom_dirty = true; eeprom_dirty = true;
crc16(crc, value, size); crc16(crc, value, size);

View file

@ -58,7 +58,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) {
#if NONE(SPI_EEPROM, I2C_EEPROM) #if NONE(SPI_EEPROM, I2C_EEPROM)
if (NVMCTRL->SEESTAT.bit.RLOCK) if (NVMCTRL->SEESTAT.bit.RLOCK)
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access

View file

@ -50,7 +50,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) {
while (size--) { while (size--) {
uint8_t v = *value; uint8_t v = *value;

View file

@ -40,7 +40,7 @@ bool PersistentStore::access_start() {
} }
bool PersistentStore::access_finish() { return true; } bool PersistentStore::access_finish() { 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) {
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;

View file

@ -32,7 +32,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, const size_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;

View file

@ -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, const size_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;

View file

@ -33,7 +33,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, const size_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;

View file

@ -31,7 +31,7 @@ class PersistentStore {
public: public:
static bool access_start(); static bool access_start();
static bool access_finish(); static bool access_finish();
static bool write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc); static bool write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc);
static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true); static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true);
static size_t capacity(); static size_t capacity();