diff --git a/osal/FreeRTOS/PeriodicTask.cpp b/osal/FreeRTOS/PeriodicTask.cpp index 817cb06f..cc29edae 100644 --- a/osal/FreeRTOS/PeriodicTask.cpp +++ b/osal/FreeRTOS/PeriodicTask.cpp @@ -90,12 +90,9 @@ ReturnValue_t PeriodicTask::addComponent(object_id_t object, bool setTaskIF) { return HasReturnvaluesIF::RETURN_FAILED; } objectList.push_back(newObject); + newObject->setTaskIF(this); - if(setTaskIF) { - newObject->setTaskIF(this); - } - ReturnValue_t result = newObject->initializeAfterTaskCreation(); - return result; + return newObject->initializeAfterTaskCreation(); } uint32_t PeriodicTask::getPeriodMs() const { diff --git a/osal/FreeRTOS/PeriodicTask.h b/osal/FreeRTOS/PeriodicTask.h index ca2c5324..2be2521c 100644 --- a/osal/FreeRTOS/PeriodicTask.h +++ b/osal/FreeRTOS/PeriodicTask.h @@ -65,8 +65,7 @@ public: * -@c RETURN_OK on success * -@c RETURN_FAILED if the object could not be added. */ - ReturnValue_t addComponent(object_id_t object, - bool setTaskIF = true) override; + ReturnValue_t addComponent(object_id_t object) override; uint32_t getPeriodMs() const override; diff --git a/osal/linux/PeriodicPosixTask.cpp b/osal/linux/PeriodicPosixTask.cpp index 4b0c77fc..cd487531 100644 --- a/osal/linux/PeriodicPosixTask.cpp +++ b/osal/linux/PeriodicPosixTask.cpp @@ -22,8 +22,7 @@ void* PeriodicPosixTask::taskEntryPoint(void* arg) { return NULL; } -ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object, - bool setTaskIF) { +ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object) { ExecutableObjectIF* newObject = objectManager->get( object); if (newObject == nullptr) { @@ -32,13 +31,9 @@ ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object, return HasReturnvaluesIF::RETURN_FAILED; } objectList.push_back(newObject); + newObject->setTaskIF(this); - if(setTaskIF) { - newObject->setTaskIF(this); - } - - ReturnValue_t result = newObject->initializeAfterTaskCreation(); - return result; + return newObject->initializeAfterTaskCreation(); } ReturnValue_t PeriodicPosixTask::sleepFor(uint32_t ms) { diff --git a/osal/linux/PeriodicPosixTask.h b/osal/linux/PeriodicPosixTask.h index 9b477e36..0b2d51cd 100644 --- a/osal/linux/PeriodicPosixTask.h +++ b/osal/linux/PeriodicPosixTask.h @@ -39,8 +39,7 @@ 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, - bool setTaskIF = true) override; + ReturnValue_t addComponent(object_id_t object) override; uint32_t getPeriodMs() const override; diff --git a/tasks/PeriodicTaskIF.h b/tasks/PeriodicTaskIF.h index 6f490977..f54d6155 100644 --- a/tasks/PeriodicTaskIF.h +++ b/tasks/PeriodicTaskIF.h @@ -36,8 +36,7 @@ public: * to the component. * @return */ - virtual ReturnValue_t addComponent(object_id_t object, - bool setTaskIF = true) { + virtual ReturnValue_t addComponent(object_id_t object) { return HasReturnvaluesIF::RETURN_FAILED; };