1
0
forked from fsfw/fsfw

integrated interface into bin semaphore

This commit is contained in:
2020-05-18 19:38:02 +02:00
parent 9ba21b1e28
commit 4dd6594845
3 changed files with 27 additions and 9 deletions

View File

@ -2,7 +2,7 @@
#define FRAMEWORK_OSAL_FREERTOS_BINARYSEMPAHORE_H_
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/tasks/SemaphoreIF.h>
extern "C" {
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
@ -21,7 +21,8 @@ extern "C" {
* @author R. Mueller
* @ingroup osal
*/
class BinarySemaphore: public HasReturnvaluesIF {
class BinarySemaphore: public SemaphoreIF,
public HasReturnvaluesIF {
public:
static const uint8_t INTERFACE_ID = CLASS_ID::SEMAPHORE_IF;
@ -67,6 +68,12 @@ public:
*/
virtual ~BinarySemaphore();
ReturnValue_t acquire(uint32_t timeoutMs =
BinarySemaphore::NO_BLOCK_TIMEOUT) override;
ReturnValue_t release() override;
uint8_t getSemaphoreCounter() override;
/**
* Take the binary semaphore.
* If the semaphore has already been taken, the task will be blocked