mbed library sources
Dependents: Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more
Superseded
This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.
Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.
If you are looking for a stable and tested release, please import one of the official mbed library releases:
Import librarymbed
The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Diff: targets/cmsis/TARGET_STM/TARGET_NUCLEO_F401RE/stm32f4xx_hal_flash.c
- Revision:
- 369:2e96f1b71984
- Parent:
- 226:b062af740e40
--- a/targets/cmsis/TARGET_STM/TARGET_NUCLEO_F401RE/stm32f4xx_hal_flash.c Mon Oct 27 08:00:06 2014 +0000 +++ b/targets/cmsis/TARGET_STM/TARGET_NUCLEO_F401RE/stm32f4xx_hal_flash.c Mon Oct 27 09:45:07 2014 +0000 @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_flash.c * @author MCD Application Team - * @version V1.1.0RC2 - * @date 14-May-2014 + * @version V1.1.0 + * @date 19-June-2014 * @brief FLASH HAL module driver. * This file provides firmware functions to manage the following * functionalities of the internal FLASH memory: @@ -562,17 +562,18 @@ */ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout) { + uint32_t tickstart = 0; /* Wait for the FLASH operation to complete by polling on BUSY flag to be reset. Even if the FLASH operation fails, the BUSY flag will be reset and an error flag will be set */ - - uint32_t timeout = HAL_GetTick() + Timeout; - + /* Get tick */ + tickstart = HAL_GetTick(); + while(__HAL_FLASH_GET_FLAG(FLASH_FLAG_BSY) != RESET) { if(Timeout != HAL_MAX_DELAY) { - if(HAL_GetTick() >= timeout) + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) { return HAL_TIMEOUT; } @@ -707,7 +708,7 @@ if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_PGAERR) != RESET) { - pFlash.ErrorCode |= FLASH_ERROR_PGA; + pFlash.ErrorCode |= (FLASH_ErrorTypeDef)FLASH_ERROR_PGA; } if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_PGPERR) != RESET)