Open peterharperuk opened 1 year ago
@kilograham
Alternatively or additionally maybe provide a more generalized storage callback interface, with some default implementations. This way the user can decide where and how stuff should be stored. For instance if a filesystem is already used (like littlefs or fatfs) the user might want to store configuration values in files. Something like:
struct storage_interface {
void* user_data;
size_t (*load_value)(void* udata, const char* key, void* buffer, size_t size);
void (*store_value)(void* udata, const char* key, const void* buffer, size_t size);
// ... more? get_value_size?
};
The BT code uses two sectors at the end of flash for saving pairing info. As more people need to use flash it will get harder to coordinate flash allocations. We need some sort of API that allocates flash memory at runtime to avoid clashes?