#ifndef RT_TASKS_HELPERS
#define RT_TASKS_HELPERS
#include "rttask.h"
#include <iostream>
#include <memory>
using namespace RSI::RapidCode::RealTimeTasks;
namespace RTTaskHelper
{
#if defined(WIN32) && defined(NDEBUG)
{
std::snprintf(
RTTaskManagerCreationParameters::DirectoryLengthMaximum,
RMP_DEFAULT_PATH
);
parameters.
Platform = PlatformType::INtime;
std::snprintf(
RTTaskManagerCreationParameters::NameLengthMaximum,
"NodeA"
);
return parameters;
}
#else
{
std::snprintf(
RTTaskManagerCreationParameters::DirectoryLengthMaximum,
RMP_DEFAULT_PATH
);
return parameters;
}
#endif
void InitializeRTTaskObjects(std::unique_ptr<RTTaskManager>& manager)
{
std::cout << "Running initialization task..." << std::endl;
initParams.
Repeats = RTTaskCreationParameters::RepeatNone;
std::unique_ptr<RTTask> task(manager->TaskSubmit(initParams));
constexpr int timeoutMs = 5000;
task->ExecutionCountAbsoluteWait(1, timeoutMs);
}
}
#endif
RTTaskCreationParameters specifies all the information required to create and configure a real-time t...
int32_t Repeats
Number of times the task should execute (RepeatForever for infinite, 0 for none (one-shot)).
RTTaskManagerCreationParameters specifies all the information required to create and configure an RTT...
PlatformType Platform
Platform on which the manager firmware will run.
char NodeName[NameLengthMaximum]
[INtime] Name of the node on which the manager will run.
char RTTaskDirectory[DirectoryLengthMaximum]
Path to the directory containing the real-time task libraries.