NVProperty generic key value store using the MCU flash area.
Dependents: Turtle_RadioShuttle
Diff: NVProperty_MBEDFlash.h
- Revision:
- 5:2560e615ccd5
- Parent:
- 4:eb6850e3bc21
- Child:
- 6:633f80228fc8
diff -r eb6850e3bc21 -r 2560e615ccd5 NVProperty_MBEDFlash.h --- a/NVProperty_MBEDFlash.h Thu Jan 31 21:31:29 2019 +0100 +++ b/NVProperty_MBEDFlash.h Fri Feb 01 13:21:55 2019 +0100 @@ -42,9 +42,12 @@ uint16_t sizeKB; }; - static const int FLASH_ENTRY_MIN_SIZE = 8; - static const int MAX_DATA_ENTRY = 256-FLASH_ENTRY_MIN_SIZE; - static const int FLASH_PADDING_SIZE = 8; // writes sizes and alignment must be multiple of 64-bit, + static const int FLASH_ENTRY_HEADER = 4; + static const int FLASH_ENTRY_HEADER_SHORT = 2; + static const int MAX_DATA_ENTRY = 256; + +// static const int FLASH_ENTRY_MIN_SIZE = 8; +// static const int FLASH_PADDING_SIZE = 8; // writes sizes and alignment must be multiple of 64-bit, struct _flashEntry { uint8_t key; // Property key @@ -86,12 +89,8 @@ uint8_t *_startAddress; uint8_t *_endAddress; - static const int FLASH_PROP_MAGIC = 0x4c6f5261; // "LORA" - static const int FLASH_PROP_VERSION = 3; - static const int _bootlLoaderSize = 8192; - static const int _lockRegions = 16; // d21 lock regions are always 16 for the entire ram - - + static const int FLASH_PROP_MAGIC = 0x4e564d42; // "NVMB" + static const int FLASH_PROP_VERSION = 1; }; #endif // __NVPROPERTY_MBEDLASH__