AP_Bootloader: skip erasing already erased pages

This commit is contained in:
Andrew Tridgell 2018-06-25 10:33:28 +10:00
parent feefa05b41
commit 5b208b401f
1 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,9 @@ uint32_t flash_func_sector_size(uint32_t sector)
void flash_func_erase_sector(uint32_t sector)
{
stm32_flash_erasepage(flash_base_page+sector);
if (!stm32_flash_ispageerased(flash_base_page+sector)) {
stm32_flash_erasepage(flash_base_page+sector);
}
}
// read one-time programmable memory