Use 32-bit variable for 32-bit read. (Also fixes DEBUG compile

error due to mismatch of format and argument.)
This commit is contained in:
Jeremy Elson 2019-02-24 17:42:09 -08:00
parent a3bbdc26c0
commit 86ed86c2a2
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;