26 #define CH_STORAGE_SIZE HAL_STORAGE_SIZE 28 #ifndef HAL_USE_EMPTY_STORAGE 32 #define CH_STORAGE_LINE_SHIFT 3 34 #define CH_STORAGE_LINE_SIZE (1<<CH_STORAGE_LINE_SHIFT) 35 #define CH_STORAGE_NUM_LINES (CH_STORAGE_SIZE/CH_STORAGE_LINE_SIZE) 40 void read_block(
void *dst, uint16_t src,
size_t n);
41 void write_block(uint16_t dst,
const void* src,
size_t n);
53 bool _flash_write_data(uint8_t sector, uint32_t offset,
const uint8_t *data, uint16_t length);
54 bool _flash_read_data(uint8_t sector, uint32_t offset, uint8_t *data, uint16_t length);
77 #endif // HAL_USE_EMPTY_STORAGE
void write_block(uint16_t dst, const void *src, size_t n)
volatile bool _initialised
void _mark_dirty(uint16_t loc, uint16_t length)
bool _flash_erase_ok(void)
void _storage_create(void)
bool _flash_read_data(uint8_t sector, uint32_t offset, uint8_t *data, uint16_t length)
uint32_t stm32_flash_getpagesize(uint32_t page)
bool _flash_erase_sector(uint8_t sector)
void _timer_tick(void) override
void read_block(void *dst, uint16_t src, size_t n)
uint8_t _buffer [CH_STORAGE_SIZE] __attribute__((aligned(4)))
#define CH_STORAGE_NUM_LINES
uint32_t _last_re_init_ms
bool _flash_write_data(uint8_t sector, uint32_t offset, const uint8_t *data, uint16_t length)
#define FUNCTOR_BIND_MEMBER(func, rettype,...)
void _flash_write(uint16_t line)