determination of freeRTOS features from version
This commit is contained in:
parent
9170f466e8
commit
b8f4d8690b
@ -10,9 +10,6 @@
|
||||
#if (tskKERNEL_VERSION_MAJOR == 8 && tskKERNEL_VERSION_MINOR > 2) || \
|
||||
tskKERNEL_VERSION_MAJOR > 8
|
||||
|
||||
// todo: does not work for older FreeRTOS version, so we should
|
||||
// actually check whether tskKERNEL_VERSION_MAJOR is larger than.. 7 or 8 ?
|
||||
|
||||
/**
|
||||
* @brief Binary Semaphore implementation using the task notification value.
|
||||
* The notification value should therefore not be used
|
||||
|
@ -80,10 +80,16 @@ void PeriodicTask::taskFunctionality() {
|
||||
object->performOperation();
|
||||
}
|
||||
|
||||
checkMissedDeadline(xLastWakeTime, xPeriod);
|
||||
|
||||
vTaskDelayUntil(&xLastWakeTime, xPeriod);
|
||||
|
||||
#if (tskKERNEL_VERSION_MAJOR == 10 && tskKERNEL_VERSION_MINOR >= 4) || \
|
||||
tskKERNEL_VERSION_MAJOR > 10
|
||||
BaseType_t wasDelayed = xTaskDelayUntil(&xLastWakeTime, xPeriod);
|
||||
if(wasDelayed == pdFALSE) {
|
||||
handleMissedDeadline();
|
||||
}
|
||||
#else
|
||||
checkMissedDeadline(xLastWakeTime, xPeriod);
|
||||
vTaskDelayUntil(&xLastWakeTime, xPeriod);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,8 +118,6 @@ void PeriodicTask::checkMissedDeadline(const TickType_t xLastWakeTime,
|
||||
* it. */
|
||||
TickType_t currentTickCount = xTaskGetTickCount();
|
||||
TickType_t timeToWake = xLastWakeTime + interval;
|
||||
#if tskKERNEL_VERSION_MAJOR >= 10 && tskKERNEL_VERSION_MINOR > 4)
|
||||
#else
|
||||
// Time to wake has not overflown.
|
||||
if(timeToWake > xLastWakeTime) {
|
||||
/* If the current time has overflown exclusively or the current
|
||||
@ -128,7 +132,7 @@ void PeriodicTask::checkMissedDeadline(const TickType_t xLastWakeTime,
|
||||
else if((timeToWake < xLastWakeTime) and (currentTickCount > timeToWake)) {
|
||||
handleMissedDeadline();
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
TaskHandle_t PeriodicTask::getTaskHandle() {
|
||||
|
@ -71,6 +71,7 @@ public:
|
||||
|
||||
TaskHandle_t getTaskHandle() override;
|
||||
protected:
|
||||
|
||||
bool started;
|
||||
TaskHandle_t handle;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user