APIs, concepts, guides, and more
RTTaskCreationParameters

RTTaskCreationParameters specifies all the information required to create and configure a real-time task, including the function to execute, priority, and whether to enable execution timing. Use with RTTaskManager::TaskSubmit() and see Real-Time Tasks for more information. More...

Functions

 RTTaskCreationParameters (const char *const argFunctionName, const char *const argLibraryName=nullptr, const char *const argLibraryDirectory=nullptr)
 Constructor with function name and library details.
 

Attributes

bool EnableTiming = EnableTimingDefault
 Whether to enable timing measurements for the task. Keep in mind, enabling timing does add a small amount of overhead to the task execution.
 
char FunctionName [NameLengthMaximum] = {0}
 Name of the task function to execute.
 
char LibraryDirectory [DirectoryLengthMaximum] = {0}
 Path to the directory containing the library with the task function.
 
char LibraryName [NameLengthMaximum] = "RTTaskFunctions"
 Name of the library containing the task function.
 
int32_t Period = PeriodDefault
 Execution period of the task in RMP sample periods.
 
int32_t Phase = PhaseDefault
 Phase offset for task execution. For example, if you have 4 tasks with a period of 4, you can set the phase of each task to 0, 1, 2, and 3 so that they don't all execute on the same sample period.
 
TaskPriority Priority = PriorityDefault
 Priority of the task (coming soon).
 
int32_t Repeats = RepeatNone
 Number of times the task should execute (RepeatForever for infinite, 0 for none (one-shot)).
 
char UserLabel [NameLengthMaximum] = {0}
 User-defined label for the task.
 

Static Attributes

static constexpr int32_t DirectoryLengthMaximum = 256
 Maximum length of the library directory path.
 
static constexpr bool EnableTimingDefault = false
 Default setting for timing measurements.
 
static constexpr const char *const LibraryNameDefault = "RTTaskFunctions"
 Default library name for the task function.
 
static constexpr int32_t NameLengthMaximum = 64
 Maximum length of name fields (library, function, user label).
 
static constexpr int32_t PeriodDefault = 1
 Default execution period in RMP sample periods.
 
static constexpr int32_t PhaseDefault = 0
 Default phase offset for task execution.
 
static constexpr TaskPriority PriorityDefault = TaskPriority::Medium
 Default priority for real-time tasks.
 
static constexpr int32_t RepeatForever = -1
 Special value to indicate the task should repeat forever.
 
static constexpr int32_t RepeatNone = 0
 Special value to indicate the task should not repeat.
 

Description

Examples
HelloRTTasks.cpp, RTTasksHelpers.h, and RandomWalk.cpp.

Definition at line 123 of file rttask.h.