1
0
forked from fsfw/fsfw

moved timeslot files to task folder

implmented setting task IF for regular periodic tasks
This commit is contained in:
2020-06-19 20:14:56 +02:00
parent eb4ce980fe
commit 2de811e0af
13 changed files with 82 additions and 58 deletions

View File

@ -70,9 +70,8 @@ void PeriodicTask::taskFunctionality() {
xLastWakeTime = xTaskGetTickCount();
/* Enter the loop that defines the task behavior. */
for (;;) {
for (ObjectList::iterator it = objectList.begin();
it != objectList.end(); ++it) {
(*it)->performOperation();
for (auto const& object: objectList) {
object->performOperation();
}
/* If all operations are finished and the difference of the
@ -93,12 +92,17 @@ void PeriodicTask::taskFunctionality() {
}
}
ReturnValue_t PeriodicTask::addComponent(object_id_t object) {
ReturnValue_t PeriodicTask::addComponent(object_id_t object, bool setTaskIF) {
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
object);
if (newObject == NULL) {
if (newObject == nullptr) {
sif::error << "PeriodicTask::addComponent: Invalid object. Make sure"
"it implement ExecutableObjectIF" << std::endl;
return HasReturnvaluesIF::RETURN_FAILED;
}
if(setTaskIF) {
newObject->setTaskIF(this);
}
objectList.push_back(newObject);
return HasReturnvaluesIF::RETURN_OK;
}