-
Notifications
You must be signed in to change notification settings - Fork 1
/
enum_lists.h
77 lines (60 loc) · 1.88 KB
/
enum_lists.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
// Using a seperatre file for enums forces the compiler to recognize them first
// If enums are in the same file as the main code and used in a global function
// the compiler sometimes throws an error, even for valid code.
// Using typedef to force the enums to be of byte data types (aka uint8_t) saves memory.
// using an enum to define reference id for attached diplays.
// Main LCD display should have index 0
// Each LED display should have a value equal to its lane #.
typedef enum: uint8_t {
lcdDisp = 0,
led1Disp,
led2Disp,
led3Disp,
led4Disp
} displays;
// create enum to hold possible state values
typedef enum: uint8_t {
Menu,
Race,
Paused,
Fault,
PreStart,
Staging,
Finish,
PreFault
} states;
// Lane states to indicate different status conditions a racer can be in.
// enums default to these values, but they are written in explicitly
// in order to indicate it's important to preserve those values.
typedef enum: uint8_t{
Off = 0, // lane is not being used
Active = 1, // lane is being used and live in a race
StandBy = 2, // lane is being used in a race, but currently not active
Finished = 3 // lane has finished the race
} laneState ;
// Racetype options
typedef enum: uint8_t {
Standard, // First to finish the set number of laps
Timed, // Finish the most laps before time runs out
Drag // Drag racing mode first to 2nd lane trigger
} races;
// used to define desired clock time width when written to display;
typedef enum: uint8_t {
S = 2, // 00
M = 4, // 00:00
H = 6, // 00:00:00
} clockWidth;
// enum to name menu screens for easier reference
typedef enum: uint8_t {
MainMenu,
SettingsMenu,
SelectRacersMenu,
StartRaceMenu,
ResultsMenu
} Menus;
// enum to use names with context instead of raw numbers when coding audio state
typedef enum: uint8_t {
AllOn,
GameOnly,
Mute
} audioModes;