Non Volatile storage class for persistent settings on an external flash device.
More...
template<typename SettingStruct>
class daisy::PersistentStorage< SettingStruct >
Non Volatile storage class for persistent settings on an external flash device.
- Author
- shensley
Storage occupied by the struct will be one word larger than the SettingStruct used. The extra word is used to store the state of the data, and whether it's been overwritten or not.
- Todo
-
- Add wear leveling
template<typename SettingStruct >
State of the storage. When created, prior to initialiation, the state will be Unknown
During initialization, the state will be changed to either FACTORY, or USER.
If this is the first time these settings are being written to the target address, the defaults will be written to that location, and the state will be set to FACTORY.
Once the first user-trigger save has been made, the state will be updated to USER to indicate that the defaults have overwritten.
| Enumerator |
|---|
| UNKNOWN | |
| FACTORY | |
| USER | |