forked from spartanracingelectric/SRE5-InstrumentCluster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirmwareMachineConcept.c
More file actions
61 lines (47 loc) · 1.36 KB
/
FirmwareMachineConcept.c
File metadata and controls
61 lines (47 loc) · 1.36 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
52
53
54
55
56
57
58
59
60
61
#ifndef F_CPU
#define F_CPU 16000000UL
#endif
LCD needs SOC and Temp
#include <avr/io.h>
//#define BUTTON1
int main(void) {
int stateNum = 1; //every time the car or instrument cluster turns on, start at STATE_WAKE
while (1) {
switch (stateNum) {
//STATE_WAKE
case 1: //stateNum == 1, wake
/*
- Display LCD message to test if LCD works
- LED patterns and blinks to test they are working too
- Basically a bunch of statements to test hardware, preferably quick ones to allow for functionality ASAP
- stateNum = 2;
- break;
*/
//STATE_MAIN
case 2: //stateNum == 2, main screen
/*
- Take in and process CAN packets
- Record CAN Packet to SD Card
- Update LCD/LEDs
- Read for button press to change engine-state
*/
/**
//STATE_SETTINGS
case 3: //stateNum == 3, settings menu
/*
- LCD controlled, change settings with buttons (if (buttonPressed) to toggle through and select in a menu)
- Timeout in case driver accidentally hits button, maybe like 15 seconds -> stateNum = 2 to go back to STATE_MAIN
- On settings exit, stateNum = 2 to go back to STATE_MAIN
- break;
*/
//STATE_DEBUG
case 4: //stateNum == 4, debug menu
/*
- Debugging mode?
- On debugging exit, stateNum = 2 to go back to STATE_MAIN
- break;
*/
**/
}
}
}