1
0
forked from fsfw/fsfw

Adding Code for freeRTOS

This commit is contained in:
2018-07-13 15:56:37 +02:00
parent d1bc3a71a1
commit db1f93a155
37 changed files with 1332 additions and 73 deletions

View File

@ -30,7 +30,7 @@ void FixedSlotSequence::executeAndAdvance() {
}
}
uint32_t FixedSlotSequence::getIntervalMs() {
uint32_t FixedSlotSequence::getIntervalToNextSlotMs() {
uint32_t oldTime;
std::list<FixedSequenceSlot*>::iterator it;
it = current;
@ -53,6 +53,23 @@ uint32_t FixedSlotSequence::getIntervalMs() {
return lengthMs - oldTime + (*it)->pollingTimeMs;
}
uint32_t FixedSlotSequence::getIntervalToPreviousSlotMs() {
uint32_t currentTime;
std::list<FixedSequenceSlot*>::iterator it;
it = current;
// Get the pollingTimeMs of the current slot object.
currentTime = (*it)->pollingTimeMs;
//if it is the first slot, calculate difference to last slot
if (it == slotList.begin()){
return lengthMs - (*(--slotList.end()))->pollingTimeMs + currentTime;
}
// get previous slot
it--;
return currentTime - (*it)->pollingTimeMs;
}
bool FixedSlotSequence::slotFollowsImmediately() {
uint32_t currentTime = (*current)->pollingTimeMs;
std::list<FixedSequenceSlot*>::iterator it;