diff options
author | Karl Palsson <karlp@tweak.net.au> | 2018-07-26 02:27:08 +0300 |
---|---|---|
committer | Karl Palsson <karlp@tweak.net.au> | 2018-08-17 03:15:01 +0300 |
commit | 3293913be24735ad5e59a5c82f95b1211729c3dd (patch) | |
tree | 168321b650665f9c5ab87a15671200417d65e59d | |
parent | d465291f45a24200e805c4f9d69b709f5727d464 (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.h | 1 | ||||
-rw-r--r-- | lib/stm32/f3/flash.c | 6 |
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(); } |