rusEFI
The most advanced open source ECU
|
A base class for a controller that requires its own thread. More...
#include <thread_controller.h>
Public Member Functions | |
ThreadController (const char *name, tprio_t priority) | |
void | start () |
Start the thread. | |
void | stop () |
Request thread termination and waits for termination. | |
Protected Member Functions | |
virtual void | ThreadTask ()=0 |
void | main () override |
Protected Attributes | |
const char *const | m_name |
Private Attributes | |
const tprio_t | m_prio |
bool | m_started = false |
chibios_rt::ThreadReference | ref |
A base class for a controller that requires its own thread.
Inherit from ThreadController. Implement ThreadTask with the logic required for your thread. The template parameter specifies the size of the stack used for the thread. (because we have to allocate the stack at compile time, it has to be a template parameter instead of a normal parameter)
Definition at line 18 of file thread_controller.h.
|
inline |
Definition at line 39 of file thread_controller.h.
|
inlineoverrideprotected |
Definition at line 30 of file thread_controller.h.
|
inline |
Start the thread.
Definition at line 50 of file thread_controller.h.
Referenced by initUsbMsd().
|
inline |
Request thread termination and waits for termination.
Thread should periadicaly execute something like: if (chThdShouldTerminateX()) chThdExit((msg_t)0x0);
Definition at line 66 of file thread_controller.h.
|
protectedpure virtual |
Implemented in TunerstudioThread, MassStorageController, StepperMotor, PeriodicController< TStackSize >, PeriodicController< 1024 >, PeriodicController< 256 >, PeriodicController< 512 >, and PeriodicController< UTILITY_THREAD_STACK_SIZE >.
Referenced by ThreadController< TStackSize >::main().
|
protected |
Definition at line 36 of file thread_controller.h.
Referenced by ThreadController< TStackSize >::main(), and PeriodicController< TStackSize >::ThreadTask().
|
private |
Definition at line 21 of file thread_controller.h.
Referenced by ThreadController< TStackSize >::start().
|
private |
Definition at line 23 of file thread_controller.h.
Referenced by ThreadController< TStackSize >::start(), and ThreadController< TStackSize >::stop().
|
private |
Definition at line 24 of file thread_controller.h.
Referenced by ThreadController< TStackSize >::start(), and ThreadController< TStackSize >::stop().