moved timeslot files to task folder
implmented setting task IF for regular periodic tasks
This commit is contained in:
@ -24,9 +24,14 @@ void* PeriodicPosixTask::taskEntryPoint(void* arg) {
|
||||
ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object) {
|
||||
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
||||
object);
|
||||
if (newObject == NULL) {
|
||||
if (newObject == nullptr) {
|
||||
sif::error << "PeriodicTask::addComponent: Invalid object. Make sure"
|
||||
"it implements ExecutableObjectIF" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
if(setTaskIF) {
|
||||
newObject->setTaskIF(this);
|
||||
}
|
||||
objectList.push_back(newObject);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
@ -39,7 +39,8 @@ public:
|
||||
* @param object Id of the object to add.
|
||||
* @return RETURN_OK on success, RETURN_FAILED if the object could not be added.
|
||||
*/
|
||||
ReturnValue_t addComponent(object_id_t object);
|
||||
ReturnValue_t addComponent(object_id_t object,
|
||||
bool setTaskIF = true) override;
|
||||
|
||||
uint32_t getPeriodMs() const;
|
||||
|
||||
|
Reference in New Issue
Block a user