gcode_D EEPROM size, cleanup
Fixes #19920 Co-Authored-By: Orel <37673727+0r31@users.noreply.github.com>
This commit is contained in:
@ -261,7 +261,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_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 {
|
||||
const uint8_t c = TERN(FLASH_EEPROM_LEVELING, ram_eeprom[pos], eeprom_buffered_read_byte(pos));
|
||||
if (writing) *value = c;
|
||||
|
@ -78,7 +78,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
uint8_t c = HAL_eeprom_data[pos + i];
|
||||
if (writing) value[i] = c;
|
||||
|
@ -52,7 +52,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_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 {
|
||||
// Read from either external EEPROM, program flash or Backup SRAM
|
||||
const uint8_t c = ( *(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)) );
|
||||
|
@ -65,7 +65,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_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 {
|
||||
// Read from either external EEPROM, program flash or Backup SRAM
|
||||
const uint8_t c = eeprom_read_byte((uint8_t*)pos);
|
||||
|
Reference in New Issue
Block a user