-
Notifications
You must be signed in to change notification settings - Fork 1
/
app_config.h
78 lines (65 loc) · 1.29 KB
/
app_config.h
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
71
72
73
74
75
76
77
78
/*
* author : Shuichi TAKANO
* since : Sun Apr 07 2024 13:49:27
*/
#pragma once
#include <cstdint>
#include <array>
class Serializer;
class Deserializer;
struct AppConfig
{
static inline constexpr int VERSION = 1;
struct RapidSetting
{
uint32_t mask = 0;
int div = 1;
};
enum class ButtonDispMode
{
INPUT_BUTTONS,
RAPID_BUTTONS,
NONE,
};
enum class RotEncAxis
{
NONE,
X,
Y,
Z,
RX,
RY,
RZ,
SLIDER,
DIAL,
WHEEL,
};
struct RotEnc
{
int reverse = true;
int scale = 50;
int axis = 0;
};
int initPowerOn = 0;
int dispFPS = 1;
int buttonDispMode = 0;
int backLight = 1;
// int LCDContrast = 0;
int rapidModeSynchro = 1;
int softwareRapidSpeed = 10;
std::array<int, 6> rapidPhase = {0, 1, 0, 1, 0, 1};
RapidSetting rapidSettings[2];
std::array<RotEnc, 2> rotEnc{};
int nAnalogAxis = 0;
public:
ButtonDispMode getButtonDispMode() const
{
return static_cast<ButtonDispMode>(buttonDispMode);
}
void resetRapidPhase()
{
rapidPhase = {0, 1, 0, 1, 0, 1};
}
void serialize(Serializer &s);
bool deserialize(Deserializer &s);
};