Adding Code for freeRTOS
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user