X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstmf0%2Fao_flash_stm.c;h=a33099ab2a7ae9bd3e70638ca045a9d945e0f07c;hb=b23ac7ea00ec26779354869765ced9caa2d05738;hp=2d57eea72701eefeae6e61ad0a6fc0395cf2dac7;hpb=affcf6ffc08313151541993ee543bfe390165e81;p=fw%2Faltos diff --git a/src/stmf0/ao_flash_stm.c b/src/stmf0/ao_flash_stm.c index 2d57eea7..a33099ab 100644 --- a/src/stmf0/ao_flash_stm.c +++ b/src/stmf0/ao_flash_stm.c @@ -52,7 +52,7 @@ ao_flash_lock(void) #define ao_flash_wait_bsy() do { while (stm_flash.sr & (1 << STM_FLASH_SR_BSY)); } while (0) -static void __attribute__ ((section(".ramtext"),noinline)) +static void __attribute__ ((section(".sdata2.flash"), noinline)) _ao_flash_erase_page(uint32_t *page) { stm_flash.cr |= (1 << STM_FLASH_CR_PER); @@ -63,7 +63,7 @@ _ao_flash_erase_page(uint32_t *page) ao_flash_wait_bsy(); - stm_flash.cr &= ~(1 << STM_FLASH_CR_PER); + stm_flash.cr &= ~(1UL << STM_FLASH_CR_PER); } static uint32_t @@ -103,7 +103,7 @@ ao_flash_erase_page(uint32_t *page) ao_arch_release_interrupts(); } -static void __attribute__ ((section(".ramtext"), noinline)) +static void __attribute__ ((section(".sdata2.flash"), noinline)) _ao_flash_page(uint16_t *dst, uint16_t *src) { uint8_t i; @@ -115,7 +115,7 @@ _ao_flash_page(uint16_t *dst, uint16_t *src) ao_flash_wait_bsy(); } - stm_flash.cr &= ~(1 << STM_FLASH_CR_PG); + stm_flash.cr &= ~(1UL << STM_FLASH_CR_PG); } void