#ifndef FAKE_FLASH_H #define FAKE_FLASH_H #include #include "config/nl_flash.h" #define FAKE_FLASH_SECTORS 8u #define FAKE_FLASH_SIZE (FAKE_FLASH_SECTORS * NL_FLASH_SECTOR_SIZE) extern uint8_t fake_flash_mem[FAKE_FLASH_SIZE]; extern unsigned fake_flash_erases[FAKE_FLASH_SECTORS]; extern unsigned fake_flash_dirty_writes; /* writes onto non-erased bytes (store bug) */ void fake_flash_reset(void); /* Simulate power loss: after `bytes` more written bytes every write/erase fails. -1 = never. */ void fake_flash_fail_after(long bytes); #endif