FreeRTOS C++ Wrappers
1.6.0
C++ interface to FreeRTOS
|
#include <semaphore.hpp>
Public Member Functions | |
bool | Take (TickType_t Timeout=portMAX_DELAY) |
bool | Give () |
bool | TakeFromISR (BaseType_t *pxHigherPriorityTaskWoken) |
bool | GiveFromISR (BaseType_t *pxHigherPriorityTaskWoken) |
virtual | ~Semaphore () |
Protected Member Functions | |
Semaphore () | |
Protected Attributes | |
SemaphoreHandle_t | handle |
Base wrapper class around FreeRTOS's implementation of semaphores.
It is not expected that an application will derive from this class.
Note that we distinguish between Semaphore, Binary Semaphores, Counting Semaphores, and Mutexes. Mutexes, while implemented as a kind of semaphore in FreeRTOS, are conceptually very different in use and behavior from semaphores. We acknowledge this difference in the class heirarchy, implementing mutextes as a completely different class heirarchy.
Definition at line 119 of file semaphore.hpp.
|
virtual |
Our destructor
Definition at line 91 of file csemaphore.cpp.
|
protected |
We do not want a Semaphore ctor. This class should never be directly created, this is a base class only.
Definition at line 86 of file csemaphore.cpp.
bool Semaphore::Give | ( | ) |
Release (give) a semaphore.
Definition at line 66 of file csemaphore.cpp.
bool Semaphore::GiveFromISR | ( | BaseType_t * | pxHigherPriorityTaskWoken | ) |
Release (give) a semaphore from ISR context.
pxHigherPriorityTaskWoken | Did this operation result in a rescheduling event. |
Definition at line 76 of file csemaphore.cpp.
bool Semaphore::Take | ( | TickType_t | Timeout = portMAX_DELAY | ) |
Aquire (take) a semaphore.
Example of blocking indefinitely: aSemaphore.Take();
Example of blocking for 100 ticks: aSemaphore.Take(100);
Timeout | How long to wait to get the Lock until giving up. |
Definition at line 46 of file csemaphore.cpp.
bool Semaphore::TakeFromISR | ( | BaseType_t * | pxHigherPriorityTaskWoken | ) |
Aquire (take) a semaphore from ISR context.
pxHigherPriorityTaskWoken | Did this operation result in a rescheduling event. |
Definition at line 56 of file csemaphore.cpp.
|
protected |
FreeRTOS semaphore handle.
Definition at line 181 of file semaphore.hpp.