|
|
@ -43,6 +43,9 @@ bool backing_store_init(void) { |
|
|
|
bs_dprintf("Init\n"); |
|
|
|
bs_dprintf("Init\n"); |
|
|
|
flash = (BaseFlash *)&EFLD1; |
|
|
|
flash = (BaseFlash *)&EFLD1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Need to re-lock the EFL, as if we've just had the bootloader executing it'll already be unlocked.
|
|
|
|
|
|
|
|
backing_store_lock(); |
|
|
|
|
|
|
|
|
|
|
|
const flash_descriptor_t *desc = flashGetDescriptor(flash); |
|
|
|
const flash_descriptor_t *desc = flashGetDescriptor(flash); |
|
|
|
uint32_t counter = 0; |
|
|
|
uint32_t counter = 0; |
|
|
|
|
|
|
|
|
|
|
@ -132,7 +135,7 @@ bool backing_store_lock(void) { |
|
|
|
|
|
|
|
|
|
|
|
bool backing_store_read(uint32_t address, backing_store_int_t *value) { |
|
|
|
bool backing_store_read(uint32_t address, backing_store_int_t *value) { |
|
|
|
uint32_t offset = (base_offset + address); |
|
|
|
uint32_t offset = (base_offset + address); |
|
|
|
backing_store_int_t *loc = (backing_store_int_t *)offset; |
|
|
|
backing_store_int_t *loc = (backing_store_int_t *)flashGetOffsetAddress(flash, offset); |
|
|
|
*value = ~(*loc); |
|
|
|
*value = ~(*loc); |
|
|
|
bs_dprintf("Read "); |
|
|
|
bs_dprintf("Read "); |
|
|
|
wl_dump(offset, value, sizeof(backing_store_int_t)); |
|
|
|
wl_dump(offset, value, sizeof(backing_store_int_t)); |
|
|
|