stm32: flash: pull lock/unlock up to common_f.

This is a common operation, so definition in _all, and every part except
l0/l1 have the same implementation.  Bring in an _f file too.
This commit is contained in:
Karl Palsson
2018-07-13 20:58:21 +00:00
parent b23dccc7ae
commit da7ebafcbe
18 changed files with 59 additions and 114 deletions

View File

@@ -47,7 +47,7 @@ OBJS += exti_common_all.o
OBJS += adc_common_v2.o adc_common_v2_multi.o
OBJS += crc_common_all.o crc_v2.o
OBJS += crs_common_all.o
OBJS += flash_common_all.o
OBJS += flash_common_all.o flash_common_f.o
OBJS += rng_common_v1.o
OBJS += timer_common_all.o
OBJS += i2c_common_v2.o

View File

@@ -61,28 +61,6 @@ void flash_set_ws(uint32_t ws)
FLASH_ACR = reg32;
}
/** @brief Unlock the Flash Program and Erase Controller
* This enables write access to the Flash memory. It is locked by default on
* reset.
*/
void flash_unlock(void)
{
/* Clear the unlock sequence state. */
FLASH_CR |= FLASH_CR_LOCK;
/* Authorize the FPEC access. */
FLASH_KEYR = FLASH_KEYR_KEY1;
FLASH_KEYR = FLASH_KEYR_KEY2;
}
/** @brief Lock the Flash Program and Erase Controller
* Used to prevent spurious writes to FLASH.
*/
void flash_lock(void)
{
FLASH_CR |= FLASH_CR_LOCK;
}
/** @brief Clear the Programming Error Status Flag
*/
void flash_clear_pgperr_flag(void)