timeslot time 0 definitely leads to error

This commit is contained in:
Robin Müller 2020-04-01 17:19:03 +02:00
parent 335df7787a
commit bd468a1b74
1 changed files with 5 additions and 0 deletions

View File

@ -58,6 +58,11 @@ ReturnValue_t FixedTimeslotTask::startTask() {
ReturnValue_t FixedTimeslotTask::addSlot(object_id_t componentId,
uint32_t slotTimeMs, int8_t executionStep) {
if (objectManager->get<ExecutableObjectIF>(componentId) != NULL) {
if(slotTimeMs == 0) {
// TODO: FreeRTOS throws errors for zero values.
// maybe there is a better solution than this.
slotTimeMs = 1;
}
pst.addSlot(componentId, slotTimeMs, executionStep, this);
return HasReturnvaluesIF::RETURN_OK;
}