#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(uint16_t *page)
{
stm_flash.cr |= (1 << STM_FLASH_CR_PER);
#define _ao_flash_addr(pos) ((uint16_t *) (void *) ((uint8_t *) __flash__ + (pos)))
-static void __attribute ((section(".ramtext"), noinline)) _ao_flash_byte(uint32_t pos, uint8_t b)
+static void __attribute__ ((section(".sdata2.flash"), noinline))
+_ao_flash_byte(uint32_t pos, uint8_t b)
{
uint16_t v;
uint16_t *a = _ao_flash_addr(pos & ~1);
ao_flash_wait_bsy();
}
-static void __attribute__ ((section(".ramtext"), noinline))
+static void __attribute__ ((section(".sdata2.flash"), noinline))
_ao_flash_write(uint32_t pos, void *sv, uint16_t len)
{
uint8_t *s = sv;
}
uint8_t
-ao_storage_erase(uint32_t pos)
+ao_storage_device_erase(uint32_t pos)
{
ao_arch_block_interrupts();
ao_flash_unlock();
}
uint8_t
-ao_storage_device_read(uint32_t pos, __xdata void *d, uint16_t len) __reentrant
+ao_storage_device_read(uint32_t pos, void *d, uint16_t len)
{
if (pos >= ao_storage_total || pos + len > ao_storage_total)
return 0;
}
void
-ao_storage_flush(void) __reentrant
+ao_storage_flush(void)
{
}
}
void
-ao_storage_device_info(void) __reentrant
+ao_storage_device_info(void)
{
printf ("Using internal flash, page %d bytes, total %d bytes\n",
ao_storage_block, ao_storage_total);