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:
authorKarl Palsson <karlp@tweak.net.au>2018-07-26 02:27:08 +0300
committerKarl Palsson <karlp@tweak.net.au>2018-08-17 03:15:01 +0300
commit3293913be24735ad5e59a5c82f95b1211729c3dd (patch)
tree168321b650665f9c5ab87a15671200417d65e59d
parentd465291f45a24200e805c4f9d69b709f5727d464 (diff)
stm32f3: flash: add clear write protect flag
Could actually move to flash_common_f, but they have different names for the same bit at present.
-rw-r--r--include/libopencm3/stm32/f3/flash.h1
-rw-r--r--lib/stm32/f3/flash.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/libopencm3/stm32/f3/flash.h b/include/libopencm3/stm32/f3/flash.h
index 3de23cd6..ca561efb 100644
--- a/include/libopencm3/stm32/f3/flash.h
+++ b/include/libopencm3/stm32/f3/flash.h
@@ -98,6 +98,7 @@
BEGIN_DECLS
void flash_clear_pgerr_flag(void);
+void flash_clear_wrprterr_flag(void);
END_DECLS
diff --git a/lib/stm32/f3/flash.c b/lib/stm32/f3/flash.c
index f8aba91b..ffd03c30 100644
--- a/lib/stm32/f3/flash.c
+++ b/lib/stm32/f3/flash.c
@@ -51,6 +51,11 @@ void flash_clear_pgerr_flag(void)
FLASH_SR |= FLASH_SR_PGERR;
}
+void flash_clear_wrprterr_flag(void)
+{
+ FLASH_SR |= FLASH_SR_WRPRTERR;
+}
+
/*---------------------------------------------------------------------------*/
/** @brief Clear All Status Flags
@@ -60,6 +65,7 @@ Clears program error, end of operation, busy flags.
void flash_clear_status_flags(void)
{
flash_clear_pgerr_flag();
+ flash_clear_wrprterr_flag();
flash_clear_eop_flag();
}