From 46d4103c1dddd00ee3e5ff9d38a5b42923fc7fc0 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Tue, 24 Jul 2018 22:04:58 +0000 Subject: [PATCH] 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. --- lib/stm32/common/flash_common_f24.c | 5 ----- lib/stm32/f2/flash.c | 5 +++++ 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 -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 +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 +void flash_wait_for_last_operation(void) +{ + while ((FLASH_SR & FLASH_SR_BSY) == FLASH_SR_BSY); +} + /**@}*/