btstack_hal_flash_memory: fix write of 0xff bytes to simulated flash, fix #283

This commit is contained in:
Matthias Ringwald 2020-05-15 16:06:33 +02:00
parent 63efc2ed25
commit 3f054530e4
2 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- pbap_client: fix PBAP UUID len on connect message
- sm: fix secure connection pairing as peripheral when local user confirmation happens after remote one
- A2DP Source: only connect to remote sink stream endpoints
- btstack_hal_flash_memory: fix write of 0xff bytes to simulated flash
### Added
- example/le_mitm: MITM implementation that forwards ATT PDUs and allows for pairing

View File

@ -89,7 +89,10 @@ static void hal_flash_bank_memory_write(void * context, int bank, uint32_t offse
int i;
for (i=0;i<size;i++){
// write 0xff doesn't change anything
if (data[i] == 0xff) continue;
if (data[i] == 0xff) {
offset++;
continue;
}
// writing something other than 0x00 is only allowed once
if (self->banks[bank][offset] != 0xff && data[i] != 0x00){
log_error("Error: offset %u written twice. Data: 0x%02x!", offset+i, data[i]);