diff --git a/devicehandlers/FixedSlotSequence.cpp b/devicehandlers/FixedSlotSequence.cpp index 23bb0e78..f11de94b 100644 --- a/devicehandlers/FixedSlotSequence.cpp +++ b/devicehandlers/FixedSlotSequence.cpp @@ -1,5 +1,6 @@ #include #include +#include FixedSlotSequence::FixedSlotSequence(uint32_t setLengthMs) : slotLengthMs(setLengthMs) { @@ -87,7 +88,15 @@ uint32_t FixedSlotSequence::getLengthMs() const { } ReturnValue_t FixedSlotSequence::checkSequence() const { - // Iterate through slotList and check successful creation. + if(slotList.empty()) { + error << "Fixed Slot Sequence: Slot list is empty!" << std::endl; + // does check sequence have to be const? + // if I want to check a class, I need the ability to set + // internal class states. + //isEmpty = true; + std::exit(0); + } + // Iterate through slotList and check successful creation. // Checks if timing is ok (must be ascending) and if all handlers were found. auto slotIt = slotList.begin(); uint32_t count = 0; diff --git a/devicehandlers/FixedSlotSequence.h b/devicehandlers/FixedSlotSequence.h index 813d2fce..cad7ee87 100644 --- a/devicehandlers/FixedSlotSequence.h +++ b/devicehandlers/FixedSlotSequence.h @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -23,7 +24,6 @@ using SlotListIter = std::multiset::iterator; class FixedSlotSequence { public: - /** * @brief The constructor of the FixedSlotSequence object. * @@ -127,6 +127,8 @@ protected: SlotList slotList; uint32_t slotLengthMs; + + bool isEmpty = false; }; #endif /* FIXEDSLOTSEQUENCE_H_ */ diff --git a/osal/FreeRTOS/FixedTimeslotTask.cpp b/osal/FreeRTOS/FixedTimeslotTask.cpp index b1c97420..db0247a4 100644 --- a/osal/FreeRTOS/FixedTimeslotTask.cpp +++ b/osal/FreeRTOS/FixedTimeslotTask.cpp @@ -112,7 +112,6 @@ void FixedTimeslotTask::taskFunctionality() { vTaskDelayUntil(&xLastWakeTime, interval); //TODO deadline missed check } - } }