stm32: flash: remove superfluous locking of option bytes

Comments were not consistent, and this serves no purpose.  There's no
reason to explicitly lock the flash first before unlocking.  These bits
are simply set when the keys are written.
This commit is contained in:
Karl Palsson 2018-07-22 20:56:28 +00:00
parent 7a27795d8c
commit 4517ec81fd
4 changed files with 0 additions and 15 deletions

View File

@ -27,9 +27,6 @@
void flash_unlock(void)
{
/* Clear the unlock state. */
FLASH_CR |= FLASH_CR_LOCK;
/* Authorize the FPEC access. */
FLASH_KEYR = FLASH_KEYR_KEY1;
FLASH_KEYR = FLASH_KEYR_KEY2;

View File

@ -96,10 +96,6 @@ reset.
void flash_unlock_option_bytes(void)
{
/* Clear the unlock state. */
FLASH_OPTCR |= FLASH_OPTCR_OPTLOCK;
/* Unlock option bytes. */
FLASH_OPTKEYR = FLASH_OPTKEYR_KEY1;
FLASH_OPTKEYR = FLASH_OPTKEYR_KEY2;
}

View File

@ -91,10 +91,6 @@ reset.
void flash_unlock_option_bytes(void)
{
/* Clear the unlock state. */
FLASH_OPTCR |= FLASH_OPTCR_OPTLOCK;
/* Unlock option bytes. */
FLASH_OPTKEYR = FLASH_OPTKEYR_KEY1;
FLASH_OPTKEYR = FLASH_OPTKEYR_KEY2;
}

View File

@ -98,10 +98,6 @@ void flash_clear_status_flags(void)
*/
void flash_unlock_option_bytes(void)
{
/* Clear the unlock state. */
FLASH_CR |= FLASH_CR_OPTLOCK;
/* Unlock option bytes. */
FLASH_OPTKEYR = FLASH_OPTKEYR_KEY1;
FLASH_OPTKEYR = FLASH_OPTKEYR_KEY2;
}