Merge pull request #449 from jelson/width-fix

Use 32-bit variable for 32-bit read
This commit is contained in:
UweBonnes 2019-02-25 13:21:55 +01:00 committed by GitHub
commit da62cbaa3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -188,7 +188,6 @@ static int stm32f1_flash_erase(struct target_flash *f,
target_addr addr, size_t len)
{
target *t = f->t;
uint16_t sr;
stm32f1_flash_unlock(t);
@ -212,7 +211,7 @@ static int stm32f1_flash_erase(struct target_flash *f,
}
/* Check for error */
sr = target_mem_read32(t, FLASH_SR);
uint32_t sr = target_mem_read32(t, FLASH_SR);
if ((sr & SR_ERROR_MASK) || !(sr & SR_EOP)) {
DEBUG("stm32f1 flash erase error 0x%" PRIx32 "\n", sr);
return -1;