forked from WPI-HPRC/AvionicsComputer22
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSystemManager.h
More file actions
78 lines (52 loc) · 1.67 KB
/
SystemManager.h
File metadata and controls
78 lines (52 loc) · 1.67 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* SystemManager.h
* Created on: Sep 17, 2021
* Author: Peter Dentch
*/
#ifndef SYSTEMMANAGER_H_
#define SYSTEMMANAGER_H_
#include "Arduino.h"
#include <Wire.h>
#include <SPI.h>
#include "Constants.h"
#include "src/loops/Looper.h"
#include "src/loops/Loop.h"
//Individual Boards
#include "src/boards/SensorBoard.h"
#include "src/boards/ControllerBoard.h"
#include "src/boards/TelemetryBoard.h"
#include "src/boards/PowerBoard.h"
#include "src/boards/TestBoard.h"
/*
* Overall system states, main loop execution with everything necessary before and after
*/
enum SystemState {
Startup,
//WaitForConnect,
Running
//Halting
//ESTOP
};
class SystemManager{
private:
SystemState state = Startup; // initial system state is Startup
Looper * looper = new Looper(); // looper keeps track of the loops the system will be running
public:
SystemManager();
// ~SystemManager(){}
const uint32_t I2C_FREQ = I2C_BUS_FREQUENCY; // frequency of the I2C bus for peripheral interfacing
const uint32_t SPI_FREQ = SPI_SCK_FREQUENCY; // frequency of the SPI SCK clock for peripheral interfacing
const uint32_t BAUD = DEBUG_BAUD_RATE; // baud rate for serial prints from the Teensy
//#ifdef USE_ROBOT_SYSTEM
//Robot * robot = new Robot();
//#endif
//Individual Boards
//SensorBoard * sensorBoard = new SensorBoard();
//ControllerBoard * controllerBoard = new ControllerBoard();
TelemetryBoard * telemetryBoard = new TelemetryBoard();
//PowerBoard * powerBoard = new PowerBoard();
//TestBoard * testBoard = new TestBoard();
void mainSetup();
void mainLoop();
};
#endif /* SYSTEMMANAGER_H_ */