FreeRTOS C++ Wrappers  1.6.0
C++ interface to FreeRTOS
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
cpp_freertos::TickHook Class Referenceabstract

#include <tickhook.hpp>

Collaboration diagram for cpp_freertos::TickHook:
Collaboration graph
[legend]

Public Member Functions

 TickHook ()
 
virtual ~TickHook ()
 
void Register ()
 
void Disable ()
 
void Enable ()
 

Protected Member Functions

virtual void Run ()=0
 

Private Member Functions

friend void ::vApplicationTickHook ()
 

Private Attributes

bool Enabled
 

Static Private Attributes

static std::list< TickHook * > Callbacks
 

Detailed Description

Wrapper class for Tick hooks, functions you want to run within the tick ISR.

This is an abstract base class. To use this, you need to subclass it. All of your tick functions should be derived from this class. Then implement the virtual Run function.

You can register multiple hooks with this class. The order of execution should not be assumed. All tick hooks will execute every tick.

Definition at line 70 of file tickhook.hpp.

Constructor & Destructor Documentation

◆ TickHook()

TickHook::TickHook ( )

Constructor.

Definition at line 51 of file ctickhook.cpp.

◆ ~TickHook()

TickHook::~TickHook ( )
virtual

Destructor

Definition at line 57 of file ctickhook.cpp.

Member Function Documentation

◆ Disable()

void TickHook::Disable ( )

Disable the tick hook from running, without removing it from the tick hook list.

Definition at line 73 of file ctickhook.cpp.

◆ Enable()

void TickHook::Enable ( )

Enable this Idle Hook to run. This call is not necessary if you haven't called Disable.

Definition at line 81 of file ctickhook.cpp.

◆ Register()

void TickHook::Register ( )

After this is called your Run routine will execute in the Tick ISR. This registration cannot be done in the base class constructor. Once your object is fully constructed, you "may" call this in your derived class's constructor.

Note
Immedately after you call this function, your TickHook Run() method will run, perhaps before you even return from this call. You "must" be ready to run before you call Register().

Definition at line 65 of file ctickhook.cpp.

◆ Run()

virtual void cpp_freertos::TickHook::Run ( )
protectedpure virtual

Implementation of your actual Tick Hook code. You must override this function.

◆ void ::vApplicationTickHook()

cpp_freertos::TickHook::void ::vApplicationTickHook ( )
private

Allow the global vApplicationTickHook() function access to the internals of this class. This simplifies the overall design.

Member Data Documentation

◆ Callbacks

list< TickHook * > TickHook::Callbacks
staticprivate

List of Tick Hook callbacks that are executed in the Tick ISR.

Definition at line 137 of file tickhook.hpp.

◆ Enabled

bool cpp_freertos::TickHook::Enabled
private

Should the tick hook run?

Definition at line 142 of file tickhook.hpp.


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