forked from ch570512/Qlockwork
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSettings.h
More file actions
70 lines (59 loc) · 1.51 KB
/
Settings.h
File metadata and controls
70 lines (59 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//*****************************************************************************
// Settings.h
//*****************************************************************************
#ifndef SETTINGS_H
#define SETTINGS_H
#include <Arduino.h>
#include <EEPROM.h>
#include "Colors.h"
#include "Configuration.h"
#include "Languages.h"
#include "Modes.h"
#include "Event.h"
#define SETTINGS_MAGIC_NUMBER 0x2A
#define SETTINGS_VERSION 0
#define MOOD_LEVEL_MAX 9
#define LEN_TS_URL 30
#define LEN_OW_API_KEY 33
#define LEN_OW_LOCATION 30
#define NUM_EVTS 8
class Settings {
public:
Settings();
~Settings();
struct MySettings {
uint8_t magicNumber;
uint8_t version;
boolean useAbc;
int16_t brightness;
uint8_t color;
uint8_t colorChange;
uint8_t transition;
uint8_t timeout;
boolean modeChange;
boolean purist;
boolean alarm1;
time_t alarm1Time;
uint8_t alarm1Weekdays;
boolean alarm2;
time_t alarm2Time;
uint8_t alarm2Weekdays;
time_t nightOffTime;
time_t dayOnTime;
boolean hourBeep;
uint8_t moodRate;
event_t events[NUM_EVTS];
char timeServer[LEN_TS_URL];
char owApiKey[LEN_OW_API_KEY];
char owLocation[LEN_OW_LOCATION];
eFrontCover frontCover;
bool chGsi;
uint8_t ldrPosX;
uint8_t ldrPosY;
} mySettings;
void saveToEEPROM();
void resetToDefault();
private:
void loadFromEEPROM();
};
#endif