MRAS
Multi Rocket Avionics System
Loading...
Searching...
No Matches
MRAS_System.h
1//
2// Created by Tom Danvers on 13/12/2022.
3//
4
5#ifndef MRAS_MRAS_SYSTEM_H
6#define MRAS_MRAS_SYSTEM_H
7
8#include "Subsystem.h"
9#include "TextLogger.h"
10#include "BuzzerInterface.h"
11
19private:
26 Subsystem* subsystems[255] = {};
27
31 uint8_t subsystem_count = 0;
32
36 static MRAS_System *instance;
37
41 TextLogger* logger = nullptr;
42
43 BuzzerInterface* buzzer = nullptr;
44public:
45
49 MRAS_System(MRAS_System &other) = delete;
50
51 void operator=(const MRAS_System &) = delete;
52
53 MRAS_System() = default;
54
61 static MRAS_System* get_instance();
62
71 bool add_subsystem(Subsystem* subsystem);
72
73 void setup();
74
75 void loop();
76
82 void set_logger(TextLogger *logger);
83
90
91 void set_buzzer(BuzzerInterface *buzzer);
92
99};
100
101
102#endif //MRAS_MRAS_SYSTEM_H
Definition: BuzzerInterface.h:10
The main class of the MRAS system.
Definition: MRAS_System.h:18
static MRAS_System * get_instance()
Definition: MRAS_System.cpp:9
BuzzerInterface * get_buzzer()
Get the Buzzer that is used to buzz.
Definition: MRAS_System.cpp:67
void set_logger(TextLogger *logger)
Set the TextLogger that is used to log messages.
Definition: MRAS_System.cpp:53
MRAS_System(MRAS_System &other)=delete
bool add_subsystem(Subsystem *subsystem)
Add a Subsystem to the system.
Definition: MRAS_System.cpp:16
TextLogger * get_logger()
Get the TextLogger that is used to log messages.
Definition: MRAS_System.cpp:58
Definition: Subsystem.h:30
A base class for ArduinoTextLogger and NativeTextLogger.
Definition: TextLogger.h:18