From 22e4dabd1bf778c1a4c32aa76d8bf72b99936576 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 Mar 2020 15:39:42 +0100 Subject: [PATCH] BinSemaphore reset function added --- osal/FreeRTOS/BinarySemaphore.cpp | 5 +++++ osal/FreeRTOS/BinarySemaphore.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/osal/FreeRTOS/BinarySemaphore.cpp b/osal/FreeRTOS/BinarySemaphore.cpp index c3d573870..d429f1a07 100644 --- a/osal/FreeRTOS/BinarySemaphore.cpp +++ b/osal/FreeRTOS/BinarySemaphore.cpp @@ -79,6 +79,11 @@ ReturnValue_t BinarySemaphore::giveBinarySemaphore(SemaphoreHandle_t semaphore) } } +void BinarySemaphore::resetSemaphore() { + vSemaphoreDelete(handle); + vSemaphoreCreateBinary(handle); +} + ReturnValue_t BinarySemaphore::giveBinarySemaphoreFromISR(SemaphoreHandle_t semaphore, BaseType_t * higherPriorityTaskWoken) { if (semaphore == NULL) { diff --git a/osal/FreeRTOS/BinarySemaphore.h b/osal/FreeRTOS/BinarySemaphore.h index 7ead0d2fe..a809f0bb1 100644 --- a/osal/FreeRTOS/BinarySemaphore.h +++ b/osal/FreeRTOS/BinarySemaphore.h @@ -69,6 +69,11 @@ public: */ SemaphoreHandle_t getSemaphore(); + /** + * Reset the semaphore. + */ + void resetSemaphore(); + /** * Wrapper function to give back semaphore from handle * @param semaphore