Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stm32/common/flash_common_l01.c')
-rw-r--r--lib/stm32/common/flash_common_l01.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/stm32/common/flash_common_l01.c b/lib/stm32/common/flash_common_l01.c
index 9eceb45f..9fb1212b 100644
--- a/lib/stm32/common/flash_common_l01.c
+++ b/lib/stm32/common/flash_common_l01.c
@@ -89,6 +89,14 @@ void flash_lock(void)
flash_lock_pecr();
}
+/** @brief Unlock RUN_PD bit from FLASH_ACR register.
+ */
+void flash_unlock_acr(void)
+{
+ FLASH_PDKEYR = FLASH_PDKEYR_PDKEY1;
+ FLASH_PDKEYR = FLASH_PDKEYR_PDKEY2;
+}
+
/** @brief Write a word to eeprom
*
* @param address assumed to be in the eeprom space, no checking