From 9170f466e8ccaf74da9bd97d260fd846fcb6551a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Dec 2020 23:21:07 +0100 Subject: [PATCH] freeRTOS version checks --- osal/FreeRTOS/BinSemaphUsingTask.h | 5 +++++ osal/FreeRTOS/PeriodicTask.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/osal/FreeRTOS/BinSemaphUsingTask.h b/osal/FreeRTOS/BinSemaphUsingTask.h index 65a091a3f..0061c252f 100644 --- a/osal/FreeRTOS/BinSemaphUsingTask.h +++ b/osal/FreeRTOS/BinSemaphUsingTask.h @@ -7,6 +7,9 @@ #include #include +#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 ? @@ -90,4 +93,6 @@ protected: TaskHandle_t handle; }; +#endif + #endif /* FSFW_OSAL_FREERTOS_BINSEMAPHUSINGTASK_H_ */ diff --git a/osal/FreeRTOS/PeriodicTask.cpp b/osal/FreeRTOS/PeriodicTask.cpp index 5c0a840da..04c588d23 100644 --- a/osal/FreeRTOS/PeriodicTask.cpp +++ b/osal/FreeRTOS/PeriodicTask.cpp @@ -112,6 +112,8 @@ 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 @@ -126,6 +128,7 @@ void PeriodicTask::checkMissedDeadline(const TickType_t xLastWakeTime, else if((timeToWake < xLastWakeTime) and (currentTickCount > timeToWake)) { handleMissedDeadline(); } +#endif } TaskHandle_t PeriodicTask::getTaskHandle() {