clean up flash

This commit is contained in:
hathach committed 2019-10-15 16:39:36 +07:00
1 parent d8099f484d
commit ec90ceb3d8
3 files changed
+12 -10

No files matched your search

@@ -83,7 +83,7 @@ void flash_cache_flush (flash_cache_t* fc)
// skip erase & program if verify() exists, and memory matches
if ( !(fc->verify && fc->verify(fc->cache_addr, fc->cache_buf, FLASH_CACHE_SIZE)) )
{
// indicator
// indicator TODO allow to disable flash indicator
ledOn(LED_BUILTIN);
fc->erase(fc->cache_addr);
@@ -59,13 +59,15 @@ static bool fal_verify (uint32_t addr, void const * buf, uint32_t len);
static uint8_t _cache_buffer[FLASH_CACHE_SIZE] __attribute__((aligned(4)));
static flash_cache_t _cache = {
.erase = fal_erase,
.program = fal_program,
.read = fal_read,
.verify = fal_verify,
static flash_cache_t _cache =
{
.erase = fal_erase,
.program = fal_program,
.read = fal_read,
.verify = fal_verify,
.cache_addr = FLASH_CACHE_INVALID_ADDR,
.cache_buf = _cache_buffer
.cache_buf = _cache_buffer
};
//--------------------------------------------------------------------+
@@ -100,7 +102,7 @@ bool flash_nrf5x_erase(uint32_t addr)
//--------------------------------------------------------------------+
// HAL for caching
//--------------------------------------------------------------------+
bool fal_erase (uint32_t addr)
static bool fal_erase (uint32_t addr)
{
// Init semaphore for first call
if ( _sem == NULL )