Merge pull request 'important bugfix' (#152) from KSat/fsfw:hotfix/PeriodicTaskOverflowChecking into master
This commit is contained in:
commit
e188e65897
@ -125,19 +125,18 @@ void FixedTimeslotTask::checkMissedDeadline(const TickType_t xLastWakeTime,
|
|||||||
* it. */
|
* it. */
|
||||||
TickType_t currentTickCount = xTaskGetTickCount();
|
TickType_t currentTickCount = xTaskGetTickCount();
|
||||||
TickType_t timeToWake = xLastWakeTime + interval;
|
TickType_t timeToWake = xLastWakeTime + interval;
|
||||||
// Tick count has overflown
|
// Time to wake has not overflown.
|
||||||
if(currentTickCount < xLastWakeTime) {
|
if(timeToWake > xLastWakeTime) {
|
||||||
// Time to wake has overflown as well. If the tick count
|
/* If the current time has overflown exclusively or the current
|
||||||
// is larger than the time to wake, a deadline was missed.
|
* tick count is simply larger than the time to wake, a deadline was
|
||||||
if(timeToWake < xLastWakeTime and
|
* missed */
|
||||||
currentTickCount > timeToWake) {
|
if((currentTickCount < xLastWakeTime) or (currentTickCount > timeToWake)) {
|
||||||
handleMissedDeadline();
|
handleMissedDeadline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No tick count overflow. If the timeToWake has not overflown
|
/* Time to wake has overflown. A deadline was missed if the current time
|
||||||
// and the current tick count is larger than the time to wake,
|
* is larger than the time to wake */
|
||||||
// a deadline was missed.
|
else if((timeToWake < xLastWakeTime) and (currentTickCount > timeToWake)) {
|
||||||
else if(timeToWake > xLastWakeTime and currentTickCount > timeToWake) {
|
|
||||||
handleMissedDeadline();
|
handleMissedDeadline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,19 +108,18 @@ void PeriodicTask::checkMissedDeadline(const TickType_t xLastWakeTime,
|
|||||||
* it. */
|
* it. */
|
||||||
TickType_t currentTickCount = xTaskGetTickCount();
|
TickType_t currentTickCount = xTaskGetTickCount();
|
||||||
TickType_t timeToWake = xLastWakeTime + interval;
|
TickType_t timeToWake = xLastWakeTime + interval;
|
||||||
// Tick count has overflown
|
// Time to wake has not overflown.
|
||||||
if(currentTickCount < xLastWakeTime) {
|
if(timeToWake > xLastWakeTime) {
|
||||||
// Time to wake has overflown as well. If the tick count
|
/* If the current time has overflown exclusively or the current
|
||||||
// is larger than the time to wake, a deadline was missed.
|
* tick count is simply larger than the time to wake, a deadline was
|
||||||
if(timeToWake < xLastWakeTime and
|
* missed */
|
||||||
currentTickCount > timeToWake) {
|
if((currentTickCount < xLastWakeTime) or (currentTickCount > timeToWake)) {
|
||||||
handleMissedDeadline();
|
handleMissedDeadline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No tick count overflow. If the timeToWake has not overflown
|
/* Time to wake has overflown. A deadline was missed if the current time
|
||||||
// and the current tick count is larger than the time to wake,
|
* is larger than the time to wake */
|
||||||
// a deadline was missed.
|
else if((timeToWake < xLastWakeTime) and (currentTickCount > timeToWake)) {
|
||||||
else if(timeToWake > xLastWakeTime and currentTickCount > timeToWake) {
|
|
||||||
handleMissedDeadline();
|
handleMissedDeadline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user