Update drv_flash_f1.c

1、【修改】返回值。
This commit is contained in:
redoc 2020-03-18 15:38:10 +08:00 committed by GitHub
parent 5a5f262649
commit 4b46aafa75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,6 +219,7 @@ int stm32_flash_erase(rt_uint32_t addr, size_t size)
if(size_bank1 != stm32_flash_erase_bank(FLASH_BANK_1, addr_bank1, size_bank1)) if(size_bank1 != stm32_flash_erase_bank(FLASH_BANK_1, addr_bank1, size_bank1))
{ {
result = -RT_ERROR; result = -RT_ERROR;
goto __exit;
} }
} }
@ -228,10 +229,12 @@ int stm32_flash_erase(rt_uint32_t addr, size_t size)
if(size_bank2 != stm32_flash_erase_bank(FLASH_BANK_2, addr_bank2, size_bank2)) if(size_bank2 != stm32_flash_erase_bank(FLASH_BANK_2, addr_bank2, size_bank2))
{ {
result = -RT_ERROR; result = -RT_ERROR;
goto __exit;
} }
} }
if (result != RT_EOK) __exit:
if(result != RT_EOK)
{ {
return result; return result;
} }