diff options
author | Keith Packard <keithp@keithp.com> | 2017-04-02 15:56:17 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-04-02 15:56:17 -0700 |
commit | 3ce663875d69739cc2d43fcd88b22820cd9d6500 (patch) | |
tree | e7395836b164a25a63f949820bf05e99e2e874e4 /src | |
parent | 1f5f0638f283fbb784021873c649109d4ed0257c (diff) |
stm: Use common flash wait loop instead of inlining
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/stm/ao_flash_stm.c | 10 |
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++; |