SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
Module::Module_t Class Reference

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>

Inheritance diagram for Module::Module_t:
CAN::Canbus_t Module::ActiveModule_t b_t c_t d_t e Module::MessengerModule_t GPIO a

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
 

Detailed Description

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

Warning
Modules are only meant to be created staticly as shown above

Definition at line 64 of file mainModule.hpp.

Constructor & Destructor Documentation

◆ Module_t() [1/2]

Module::Module_t::Module_t ( )
inline

Definition at line 81 of file mainModule.hpp.

◆ Module_t() [2/2]

template<typename... T>
Module::Module_t::Module_t ( T *...  mods)
inline

Definition at line 83 of file mainModule.hpp.

Member Function Documentation

◆ getClassID()

virtual int Module::Module_t::getClassID ( ) const
inlinevirtual

Definition at line 79 of file mainModule.hpp.

◆ print()

void Module::Module_t::print ( )
protectedvirtual

Definition at line 16 of file mainModule.cpp.

◆ setup()

virtual void Module::Module_t::setup ( )
protectedvirtual

Reimplemented in CAN::Canbus_t.

Member Data Documentation

◆ classID

const int Module::Module_t::classID = 0
static

Definition at line 78 of file mainModule.hpp.

◆ id

const bitmapVal_t Module::Module_t::id
protected

Definition at line 72 of file mainModule.hpp.


The documentation for this class was generated from the following files: