From badcacad49e3790df3cda101dc9da973287238de Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Wed, 27 May 2020 11:48:11 +0200 Subject: [PATCH] added new timeout values --- osal/FreeRTOS/BinarySemaphore.cpp | 2 -- osal/FreeRTOS/SemaphoreFactory.cpp | 2 ++ osal/linux/SemaphoreFactory.cpp | 1 + tasks/SemaphoreIF.h | 4 +++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/osal/FreeRTOS/BinarySemaphore.cpp b/osal/FreeRTOS/BinarySemaphore.cpp index e6c308db5..026704d63 100644 --- a/osal/FreeRTOS/BinarySemaphore.cpp +++ b/osal/FreeRTOS/BinarySemaphore.cpp @@ -3,8 +3,6 @@ #include -const uint32_t SemaphoreIF::NO_TIMEOUT = 0; - BinarySemaphore::BinarySemaphore() { handle = xSemaphoreCreateBinary(); if(handle == nullptr) { diff --git a/osal/FreeRTOS/SemaphoreFactory.cpp b/osal/FreeRTOS/SemaphoreFactory.cpp index 9a3558913..7bd71dd7a 100644 --- a/osal/FreeRTOS/SemaphoreFactory.cpp +++ b/osal/FreeRTOS/SemaphoreFactory.cpp @@ -4,6 +4,8 @@ #include SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr; +const uint32_t SemaphoreIF::NO_TIMEOUT = 0; +const uint32_t SemaphoreIF::MAX_TIMEOUT = portMAX_DELAY; SemaphoreFactory::SemaphoreFactory() { } diff --git a/osal/linux/SemaphoreFactory.cpp b/osal/linux/SemaphoreFactory.cpp index 7b80176b0..b1100e750 100644 --- a/osal/linux/SemaphoreFactory.cpp +++ b/osal/linux/SemaphoreFactory.cpp @@ -2,6 +2,7 @@ #include const uint32_t SemaphoreIF::NO_TIMEOUT = 0; +const uint32_t SemaphoreIF::MAX_TIMEOUT = 0xFFFFFFFF; SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr; diff --git a/tasks/SemaphoreIF.h b/tasks/SemaphoreIF.h index 7dde27f43..b2b113f17 100644 --- a/tasks/SemaphoreIF.h +++ b/tasks/SemaphoreIF.h @@ -20,8 +20,10 @@ class SemaphoreIF { public: virtual~ SemaphoreIF() {}; - //!< Needs to be defined in implementation. + //! Needs to be defined in implementation. No blocking time static const uint32_t NO_TIMEOUT; + //! Needs to be defined in implementation. Blocks indefinitely. + static const uint32_t MAX_TIMEOUT; static const uint8_t INTERFACE_ID = CLASS_ID::SEMAPHORE_IF; //! Semaphore timeout static constexpr ReturnValue_t SEMAPHORE_TIMEOUT = MAKE_RETURN_CODE(1);