2#include "messageModule.hpp"
6static bool modulesOrdered =
false;
9Module_t *allModules[maxModules];
12bool Manager_t::setupModules() {
14 return modulesOrdered;
15 Log.
d(ID,
"Ordering modules", s_id);
17 for (bitmapVal_t i = 0; i < s_id; i++) {
18 Module_t *m = allModules[i];
23 modulesOrdered =
true;
25 Log.
e(ID,
"Failed to order modules");
27 return modulesOrdered;
30void Manager_t::startModules() {
31 std::lock_guard<std::mutex> lock(uMux);
33 Log.
d(ID,
"Starting modules");
34 for (bitmapVal_t i = 0; i < s_id; i++) {
35 Module_t *m = allModules[i];
38 }
else if (m->getClassID() == ActiveModule_t::classID) {
39 ActiveModule_t *am =
static_cast<ActiveModule_t *
>(m);
41 Log.
d(ID,
"Not running module, stack size 0", i);
48 Log.
e(ID,
"Failed to setup modules");
52void Manager_t::stopModules() {
53 std::lock_guard<std::mutex> lock(uMux);
54 Log.
d(ID,
"Stopping modules");
55 for (bitmapVal_t i = 0; i < s_id; i++) {
56 Module_t *m = allModules[i];
59 }
else if (m->getClassID() == ActiveModule_t::classID) {
60 ActiveModule_t *am =
static_cast<ActiveModule_t *
>(m);
66void Manager_t::restartModules() {
71void Manager_t::printModules() {
72 for (bitmapVal_t i = 0; i < s_id; i++) {
73 Module_t *m = allModules[i];
80void Manager_t::start() {
81 Log.
d(ID,
"Starting");
83 Log.
d(ID,
"Starting Loop");
85#if CONF_LOGGING_ASCII_DEBUG
86 Serial.println(Thread::infoString());
Logging::Log_t Log
The global logging object.
void d(LOG_TAG TAG, LOG_MSG message)
Log a string using a debug tag.
void e(LOG_TAG TAG, LOG_MSG message)
Log a string using an error tag.