diff options
author | Karl Palsson <karlp@tweak.net.au> | 2018-07-25 01:04:58 +0300 |
---|---|---|
committer | Karl Palsson <karlp@tweak.net.au> | 2018-07-29 23:31:17 +0300 |
commit | 46d4103c1dddd00ee3e5ff9d38a5b42923fc7fc0 (patch) | |
tree | c258714a18d6d669a6f93a8d588b26aaee2181aa | |
parent | 76d392ee47d884e08435e793764506c2b2fcc419 (diff) |
stm32: flash: move wait_for_last to f2/f4 explicitly.
We're preparing to use all the common code for f2, f4, f7 and large
chunks of l4. Extract things that we know need to be done differently
there.
-rw-r--r-- | lib/stm32/common/flash_common_f24.c | 5 | ||||
-rw-r--r-- | lib/stm32/f2/flash.c | 5 | ||||
-rw-r--r-- | lib/stm32/f4/flash.c | 5 |
3 files changed, 10 insertions, 5 deletions
diff --git a/lib/stm32/common/flash_common_f24.c b/lib/stm32/common/flash_common_f24.c index d6ae0d02..366c9e74 100644 --- a/lib/stm32/common/flash_common_f24.c +++ b/lib/stm32/common/flash_common_f24.c @@ -26,11 +26,6 @@ #include <libopencm3/stm32/flash.h> -void flash_wait_for_last_operation(void) -{ - while ((FLASH_SR & FLASH_SR_BSY) == FLASH_SR_BSY); -} - /*---------------------------------------------------------------------------*/ /** @brief Set the Program Parallelism Size diff --git a/lib/stm32/f2/flash.c b/lib/stm32/f2/flash.c index 7f8255df..be458637 100644 --- a/lib/stm32/f2/flash.c +++ b/lib/stm32/f2/flash.c @@ -49,5 +49,10 @@ #include <libopencm3/stm32/flash.h> +void flash_wait_for_last_operation(void) +{ + while ((FLASH_SR & FLASH_SR_BSY) == FLASH_SR_BSY); +} + /**@}*/ diff --git a/lib/stm32/f4/flash.c b/lib/stm32/f4/flash.c index 5353605a..020861d7 100644 --- a/lib/stm32/f4/flash.c +++ b/lib/stm32/f4/flash.c @@ -49,5 +49,10 @@ #include <libopencm3/stm32/flash.h> +void flash_wait_for_last_operation(void) +{ + while ((FLASH_SR & FLASH_SR_BSY) == FLASH_SR_BSY); +} + /**@}*/ |