SPI flash API cleanup, add async erase capability. (#23894)
This commit is contained in:
parent
641a1ce568
commit
7bc3eef8cc
5 changed files with 182 additions and 77 deletions
|
@ -58,7 +58,7 @@ bool backing_store_read(uint32_t address, backing_store_int_t *value) {
|
|||
bool backing_store_read_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) {
|
||||
bs_dprintf("Read ");
|
||||
uint32_t offset = (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET) * (EXTERNAL_FLASH_BLOCK_SIZE) + address;
|
||||
flash_status_t status = flash_read_block(offset, values, sizeof(backing_store_int_t) * item_count);
|
||||
flash_status_t status = flash_read_range(offset, values, sizeof(backing_store_int_t) * item_count);
|
||||
if (status == FLASH_STATUS_SUCCESS) {
|
||||
for (size_t i = 0; i < item_count; ++i) {
|
||||
values[i] = ~values[i];
|
||||
|
@ -88,7 +88,7 @@ bool backing_store_write_bulk(uint32_t address, backing_store_int_t *values, siz
|
|||
}
|
||||
|
||||
// Write out the block
|
||||
if (flash_write_block(offset, temp, sizeof(backing_store_int_t) * this_loop) != FLASH_STATUS_SUCCESS) {
|
||||
if (flash_write_range(offset, temp, sizeof(backing_store_int_t) * this_loop) != FLASH_STATUS_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue