![]() |
Midnight Sun Firmware
|
persist Firmware More...
Classes | |
| struct | PersistStorage |
Macros | |
| #define | PERSIST_COMMIT_TIMEOUT_MS 1000 |
Functions | |
| StatusCode | persist_init (PersistStorage *persist, uint8_t page, void *blob, size_t blob_size, bool overwrite) |
| Attempt to load stored data into the provided blob. More... | |
| StatusCode | persist_commit (PersistStorage *persist) |
| Force a persist data commit. More... | |
persist Firmware
| StatusCode persist_commit | ( | PersistStorage * | persist | ) |
Force a persist data commit.
Must be called after persist_init is called
| persist | Pointer to the persist storage instance |
| StatusCode persist_init | ( | PersistStorage * | persist, |
| uint8_t | page, | ||
| void * | blob, | ||
| size_t | blob_size, | ||
| bool | overwrite | ||
| ) |
Attempt to load stored data into the provided blob.
Reserves the entire flash page for the persistance layer instance Note that the blob must be a multiple of FLASH_WRITE_BYTES and must persist If |overwrite| is true. the persist layer overwrites invalid blobs
| persist | Pointer to the persist storage instance |
| page | Flash page selection (Max: NUM_FLASH_PAGES) for persist to initialize on |
| blob | Pointer to the struct/blob you want to save or load from flash memory |
| blob_size | Size of the struct/blob you want to save or load from flash memory |
| overwrite | Boolean flag to overwrite existing blobs |
We want to exit in three scenarios: