Started the implementation of the persistency module allowing to save and retrieve settings

This commit is contained in:
Th3maz1ng 2023-01-07 23:10:44 +01:00
parent 74d48ada96
commit 666a841026
3 changed files with 20 additions and 0 deletions

View File

@ -32,6 +32,7 @@ endif
COMPONENTS_$(TARGET) = \
$(TOP_DIR)/app/libuser$(LIB_EXT) \
$(TOP_DIR)/app/app_drivers/libappdrivers$(LIB_EXT) \
$(TOP_DIR)/app/persistency/libpersistency$(LIB_EXT) \
$(TOP_DIR)/lvgl/liblvgl$(LIB_EXT)
ifeq ($(USE_LIB), 0)

View File

@ -0,0 +1,13 @@
#include "watch_settings.h"
/* WatchSetting object with default values */
static WatchSettings_t watchSettings =
{
.timeAndDate = {.config = 0},
.display = {.brightness = 255, .sleep_timeout = 10,},
};
WatchSettings_t *persistency_get_settings(void)
{
return &watchSettings;
}

View File

@ -41,4 +41,10 @@ typedef struct WatchSettings
LanguageAndUI_t languageAndUI;
} WatchSettings_t;
WatchSettings_t *persistency_get_settings(void);
bool persistency_save_settings(void);
bool persistency_load_settings(void);
#endif //WATCH_SETTINGS_H