SAE Teensy ECU
IIT SAE Microcontroller programming
|
Module_t should be used for major components of a framework, it is used to isolate, thread, and handle dependencies between these components. More...
#include <mainModule.hpp>
Public Member Functions | |
virtual int | getClassID () const |
template<typename... T> | |
Module_t (T *...mods) | |
Static Public Attributes | |
static const int | classID = 0 |
Protected Member Functions | |
virtual void | print () |
virtual void | setup () |
Protected Attributes | |
const bitmapVal_t | id |
Module_t should be used for major components of a framework, it is used to isolate, thread, and handle dependencies between these components.
Defining a module is not straight forward and needs to be setup in a specific way. Reference the example.
Example definition:
>class mod_name : public Module::Module_t {
LOG_TAG ID = "String ID for logging";
using Module::Module_t::Module_t;
void setup() { // Setup code goes here, this includes anything that should be reset or initalized // Called on startup and whenever the ecu soft resets }
// Only runs after all modules run their setup. Loop is managed by user. void run() { while (1) { // Looping code goes here } }
>} a("String ID for logging", 2048, &b, &c, &d); // The EXACT same string as the ID,
// optionally, the stacksize this module should allocate, // and pointers to all the modules that this module depends on
Definition at line 64 of file mainModule.hpp.
|
inline |
Definition at line 81 of file mainModule.hpp.
|
inline |
Definition at line 83 of file mainModule.hpp.
|
inlinevirtual |
Definition at line 79 of file mainModule.hpp.
|
protectedvirtual |
Definition at line 16 of file mainModule.cpp.
|
protectedvirtual |
Reimplemented in CAN::Canbus_t.
|
static |
Definition at line 78 of file mainModule.hpp.
|
protected |
Definition at line 72 of file mainModule.hpp.