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

@ -62,11 +62,6 @@ ReturnValue_t FixedTimeslotTask::startTask() {
ReturnValue_t FixedTimeslotTask::addSlot(object_id_t componentId,
uint32_t slotTimeMs, int8_t executionStep) {
if (objectManager->get<ExecutableObjectIF>(componentId) != nullptr) {
if(slotTimeMs == 0) {
// FreeRTOS throws a sanity error for zero values, so we set
// the time to one millisecond.
slotTimeMs = 1;
}
pst.addSlot(componentId, slotTimeMs, executionStep, this);
return HasReturnvaluesIF::RETURN_OK;
}
@ -101,7 +96,9 @@ void FixedTimeslotTask::taskFunctionality() {
xLastWakeTime = xTaskGetTickCount();
// wait for first entry's start time
vTaskDelayUntil(&xLastWakeTime, interval);
if(interval > 0) {
vTaskDelayUntil(&xLastWakeTime, interval);
}
/* Enter the loop that defines the task behavior. */
for (;;) {
@ -137,3 +134,4 @@ ReturnValue_t FixedTimeslotTask::sleepFor(uint32_t ms) {
vTaskDelay(pdMS_TO_TICKS(ms));
return HasReturnvaluesIF::RETURN_OK;
}