2020-02-11 15:31:52 +00:00
|
|
|
#include "settings.h"
|
|
|
|
|
2020-12-12 19:46:01 +00:00
|
|
|
uint16_t COLOR_FG = 0x0000;
|
|
|
|
uint16_t COLOR_BG = 0xFFFF;
|
|
|
|
|
2020-02-11 15:31:52 +00:00
|
|
|
void setupSettings()
|
|
|
|
{
|
|
|
|
NVS.begin();
|
2020-12-12 19:46:01 +00:00
|
|
|
|
|
|
|
loadSettingsColor();
|
2020-02-11 15:31:52 +00:00
|
|
|
}
|
2020-11-30 20:35:30 +00:00
|
|
|
|
|
|
|
void settingsFactoryReset()
|
|
|
|
{
|
|
|
|
NVS.eraseAll();
|
2020-12-12 19:46:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void loadSettingsColor()
|
|
|
|
{
|
|
|
|
if (NVS.getString("device.theme") == "black")
|
|
|
|
{
|
|
|
|
COLOR_FG = 0xFFFF;
|
|
|
|
COLOR_BG = 0x0000;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
COLOR_FG = 0x0000;
|
|
|
|
COLOR_BG = 0xFFFF;
|
|
|
|
}
|
2020-11-30 20:35:30 +00:00
|
|
|
}
|