-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfiguration.h
More file actions
51 lines (35 loc) · 1.27 KB
/
Configuration.h
File metadata and controls
51 lines (35 loc) · 1.27 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
/*
Configuration.h
# Depends on:
- defaults.h
- SD_card.h
# Description:
- This is the configuration file in code form. Things changed in settings in app should be saved/loaded to/from here.
*/
#pragma once
#include "defaults.h"
// For easier use and no dependency, fixed blocks are used in the config
struct config_fixed_size_data {
char key[64];
char value[32];
config_fixed_size_data();
void reset();
void check_and_fix_eof();
};
constexpr size_t config_fixed_size_data_len = sizeof(config_fixed_size_data);
MAKE_SINGLETON_CLASS(MyConfig, {
// on file, follow order to guarantee all data is saved
uint64_t m_core_display_screen_saver_steps_time = core_display_screen_saver_steps_time;
uint64_t m_i2c_packaging_delay = i2c_packaging_delay;
bool m_wifi_hotspot = wifi_hotspot_default;
void load();
public:
MyConfig();
void save() const;
uint64_t get_core_display_screen_saver_steps_time () const;
uint64_t get_i2c_packaging_delay () const;
bool get_wifi_hotspot () const;
void set_core_display_screen_saver_steps_time (uint64_t);
void set_i2c_packaging_delay (uint64_t);
void set_wifi_hotspot (bool);
});