-
Notifications
You must be signed in to change notification settings - Fork 0
/
back_sw.c
154 lines (147 loc) · 2.93 KB
/
back_sw.c
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
switch (code_state)
{
case DN_SHORT:
switch (DisplayMode)
{
//case RealtimeVoltage: break;
case UpTresholdVoltage: break;
case DownTresholdTune: break;
case UpTresholdTune: break;
case ProtectTimerTune: break;
case ProtectTimer: break;
}
break;
case UP_SHORT:
switch (DisplayMode)
{
case RealtimeVoltage: break;
case DownTresholdVoltage: break;
case DownTresholdTune: break;
case UpTresholdTune: break;
case ProtectTimerTune: break;
case ProtectTimer: break;
}
break;
case DN_MID:
if (DisplayMode == DownTresholdVoltage)
break;
case UP_MID:
if (DisplayMode == UpTresholdVoltage)
break;
case DN_UP_MID:
switch (DisplayMode)
{
case DownTresholdVoltage: break;
case UpTresholdVoltage: break;
}
break;
}
//-----------------------------------------------------------------------------------------
switch (DisplayMode)
{
case RealtimeVoltage:
switch(code_state)
{
case DN_SHORT: DisplayMode = DownTresholdVoltage;
break;
case UP_SHORT: DisplayMode = UpTresholdVoltage;
break;
case DN_MID:
break;
case UP_MID:
break;
case DN_UP_MID:
break;
}
break;
case UpTresholdVoltage:
switch(code_state)
{
case DN_SHORT: DisplayMode = DownTresholdVoltage;
break;
case UP_SHORT:
break;
case DN_MID:
break;
case UP_MID: DisplayMode = UpTresholdTune;
break;
case DN_UP_MID: DisplayMode = ProtectTimerTune;
break;
}
break;
case DownTresholdVoltage:
switch(code_state)
{
case DN_SHORT: DownTreshold --; CheckTresholdSettings ();
break;
case UP_SHORT: DisplayMode = UpTresholdVoltage;
break;
case DN_MID: DisplayMode = DownTresholdTune;
break;
case UP_MID:
break;
case DN_UP_MID: DisplayMode = ProtectTimerTune;
break;
}
break;
case UpTresholdTune:
switch(code_state)
{
case DN_SHORT: UpTreshold --; CheckTresholdSettings ();
break;
case UP_SHORT: UpTreshold ++; CheckTresholdSettings ();
break;
case DN_MID:
break;
case UP_MID:
break;
case DN_UP_MID:
break;
}
break;
case DownTresholdTune:
switch(code_state)
{
case DN_SHORT:
break;
case UP_SHORT: DownTreshold ++; CheckTresholdSettings ();
break;
case DN_MID:
break;
case UP_MID:
break;
case DN_UP_MID:
break;
}
break;
case ProtectTimerTune:
switch(code_state)
{
case DN_SHORT: ProtectTimerMaxValue -=5; CheckTimerSettings ();
break;
case UP_SHORT: ProtectTimerMaxValue +=5; CheckTimerSettings ();
break;
case DN_MID:
break;
case UP_MID:
break;
case DN_UP_MID:
break;
}
break;
case ProtectTimer:
switch(code_state)
{
case DN_SHORT: DisplayMode = DownTresholdVoltage;
break;
case UP_SHORT: DisplayMode = UpTresholdVoltage;
break;
case DN_MID:
break;
case UP_MID:
break;
case DN_UP_MID:
break;
}
break;
}