STM32F7 : remove warning

[Warning] flash_api.c@191,14: unused variable 'tmp' [-Wunused-variable]
pull/15193/head
Jerome Coutant 2021-12-10 16:35:23 +01:00
parent 4d63929898
commit 3237bff990
1 changed files with 2 additions and 1 deletions

View File

@ -188,8 +188,9 @@ uint32_t flash_get_size(const flash_t *obj)
static uint32_t GetSector(uint32_t address)
{
uint32_t sector = 0;
uint32_t tmp = address - ADDR_FLASH_SECTOR_0;
#if (MBED_CONF_TARGET_FLASH_DUAL_BANK) && defined(FLASH_OPTCR_nDBANK)
uint32_t tmp = address - ADDR_FLASH_SECTOR_0;
if (address < ADDR_FLASH_SECTOR_4) { // Sectors 0 to 3
sector += tmp >> 14;
} else if (address < ADDR_FLASH_SECTOR_5) { // Sector 4