summaryrefslogtreecommitdiff
path: root/src/stm/ao_flash_stm.c
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2017-04-24 18:22:03 -0600
committerBdale Garbee <bdale@gag.com>2017-04-24 18:22:03 -0600
commitb91f67005709cb7f65e0a461b49b5cb0952cb391 (patch)
treee9f6c0f30a81cf30a9cfd52887171168f7830f85 /src/stm/ao_flash_stm.c
parent1e956f93e0c9f8ed6180490f80e8aead5538f818 (diff)
parent8a10ddb0bca7d6f6aa4aedda171899abd165fd74 (diff)
Merge branch 'branch-1.7' into debian
Diffstat (limited to 'src/stm/ao_flash_stm.c')
-rw-r--r--src/stm/ao_flash_stm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/stm/ao_flash_stm.c b/src/stm/ao_flash_stm.c
index c1648421..38618bbe 100644
--- a/src/stm/ao_flash_stm.c
+++ b/src/stm/ao_flash_stm.c
@@ -74,11 +74,10 @@ static void __attribute__ ((section(".ramtext"),noinline))
_ao_flash_erase_page(uint32_t *page)
{
stm_flash.pecr |= (1 << STM_FLASH_PECR_ERASE) | (1 << STM_FLASH_PECR_PROG);
-
+
*page = 0x00000000;
- while (stm_flash.sr & (1 << STM_FLASH_SR_BSY))
- ;
+ ao_flash_wait_bsy();
}
void
@@ -101,9 +100,8 @@ _ao_flash_half_page(uint32_t *dst, uint32_t *src)
stm_flash.pecr |= (1 << STM_FLASH_PECR_FPRG);
stm_flash.pecr |= (1 << STM_FLASH_PECR_PROG);
-
- while (stm_flash.sr & (1 << STM_FLASH_SR_BSY))
- ;
+
+ ao_flash_wait_bsy();
for (i = 0; i < 32; i++) {
*dst++ = *src++;