-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.hpp
More file actions
60 lines (49 loc) · 916 Bytes
/
settings.hpp
File metadata and controls
60 lines (49 loc) · 916 Bytes
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
#pragma once
#include <cstdint>
namespace settings {
struct settings_t {
uint32_t min_broadcast_interval;
uint64_t sensor_broadcast_bitmap;
float anemometer_k;
bool default_binary;
};
struct data_t {
uint32_t day;
uint32_t rain_day;
};
/**
* Reset settings to defaults
*/
void reset_settings();
/**
* Save the settings into EEPROM.
*/
void save_settings();
/**
* Save the data into EEPROM.
*/
void save_data();
/**
* Load the settings from EEPROM
*/
void load_settings();
/**
* Load the settings from EEPROM.
*
* This will return a cached global settings struct, so any changes are
* effective instantly.
*
* @return settings
*/
settings_t &settings();
/**
* Load the data from EEPROM.
*
* This will return a cached global data struct, so any changes are
* effective instantly.
*
* @return data
*/
data_t &data();
} // namespace settings
#define SENSOR_BIT(x) (1 << (x))