unleashed-firmware/applications/bt/bt_settings.c
hedger 056446dfed
[FL-2675] /int space reservation (#1448)
* storage: added global #defines for /int, /ext & /any
* storage: introduced PATH_EXT, PATH_INT& PATH_ANY macros
* core apps: moved hardcoded config files names to separate headers; prefixed them with "."; updater: added file name migration to new naming convention on backup extraction
* storage: fixed storage_merge_recursive handling of complex directory structures; storage_move_to_sd: changed data migration logic to all non-dot files & all folders
* core: added macro aliases for core record names
* Bumped protobuf commit pointer
* storage: reserved 5 pages in /int; denying write&creation of non-dot files when running out of free space

Co-authored-by: あく <alleteam@gmail.com>
2022-07-26 21:21:51 +09:00

23 lines
660 B
C

#include "bt_settings.h"
#include <furi.h>
#include <lib/toolbox/saved_struct.h>
#include <storage/storage.h>
#define BT_SETTINGS_PATH INT_PATH(BT_SETTINGS_FILE_NAME)
#define BT_SETTINGS_VERSION (0)
#define BT_SETTINGS_MAGIC (0x19)
bool bt_settings_load(BtSettings* bt_settings) {
furi_assert(bt_settings);
return saved_struct_load(
BT_SETTINGS_PATH, bt_settings, sizeof(BtSettings), BT_SETTINGS_MAGIC, BT_SETTINGS_VERSION);
}
bool bt_settings_save(BtSettings* bt_settings) {
furi_assert(bt_settings);
return saved_struct_save(
BT_SETTINGS_PATH, bt_settings, sizeof(BtSettings), BT_SETTINGS_MAGIC, BT_SETTINGS_VERSION);
}