|
| | StaticCountingSemaphore (const UBaseType_t maxCount, const UBaseType_t initialCount=0) |
| | Construct a new StaticCountingSemaphore object by calling SemaphoreHandle_t xSemaphoreCreateCountingStatic( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount, StaticSemaphore_t *pxSemaphoreBuffer ) More...
|
| |
|
| StaticCountingSemaphore (const StaticCountingSemaphore &)=delete |
| |
|
StaticCountingSemaphore & | operator= (const StaticCountingSemaphore &)=delete |
| |
|
| StaticCountingSemaphore (StaticCountingSemaphore &&) noexcept=default |
| |
|
StaticCountingSemaphore & | operator= (StaticCountingSemaphore &&) noexcept=default |
| |
|
| SemaphoreBase (const SemaphoreBase &)=delete |
| |
|
SemaphoreBase & | operator= (const SemaphoreBase &)=delete |
| |
| bool | isValid () const |
| | Function that checks if the underlying semaphore handle is not NULL. This should be used to ensure a semaphore has been created correctly. More...
|
| |
| UBaseType_t | getCount () const |
| | Function that calls UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore ) More...
|
| |
| bool | take (const TickType_t ticksToWait=portMAX_DELAY) const |
| | Function that calls xSemaphoreTake( SemaphoreHandle_t xSemaphore, TickType_t xTicksToWait ) More...
|
| |
| bool | takeFromISR (bool &higherPriorityTaskWoken) const |
| | Function that calls xSemaphoreTakeFromISR( SemaphoreHandle_t xSemaphore, signed BaseType_t *pxHigherPriorityTaskWoken) More...
|
| |
| bool | takeFromISR () const |
| | Function that calls xSemaphoreTakeFromISR( SemaphoreHandle_t xSemaphore, signed BaseType_t *pxHigherPriorityTaskWoken) More...
|
| |
| bool | give () const |
| | Function that calls xSemaphoreGive( SemaphoreHandle_t xSemaphore ) More...
|
| |
| bool | giveFromISR (bool &higherPriorityTaskWoken) const |
| | Function that calls xSemaphoreGiveFromISR( SemaphoreHandle_t xSemaphore, signed BaseType_t *pxHigherPriorityTaskWoken ) More...
|
| |
| bool | giveFromISR () const |
| | Function that calls xSemaphoreGiveFromISR( SemaphoreHandle_t xSemaphore, signed BaseType_t *pxHigherPriorityTaskWoken ) More...
|
| |
|
|
StaticSemaphore_t | staticCountingSemaphore |
| |
|
|
static void * | operator new (size_t, void *ptr) |
| |
|
static void * | operator new[] (size_t, void *ptr) |
| |
|
static void * | operator new (size_t)=delete |
| |
|
static void * | operator new[] (size_t)=delete |
| |
◆ StaticCountingSemaphore()
| FreeRTOS::StaticCountingSemaphore::StaticCountingSemaphore |
( |
const UBaseType_t |
maxCount, |
|
|
const UBaseType_t |
initialCount = 0 |
|
) |
| |
|
inlineexplicit |
Construct a new StaticCountingSemaphore object by calling SemaphoreHandle_t xSemaphoreCreateCountingStatic( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount, StaticSemaphore_t *pxSemaphoreBuffer )
- See also
- https://www.freertos.org/xSemaphoreCreateCountingStatic.html
- Warning
- This class contains the storage buffer for the counting semaphore, so the user should create this object as a global object or with the static storage specifier so that the object instance is not on the stack.
- Parameters
-
| maxCount | The maximum count value that can be reached. When the semaphore reaches this value it can no longer be 'given'. |
| initialCount | The count value assigned to the semaphore when it is created. |
Example Usage
#include <FreeRTOS/Semaphore.hpp>
#include <FreeRTOS/Task.hpp>
public:
void taskFunction() final;
};
static FreeRTOS::StaticCountingSemaphore countingSemaphore(10);
void MyTask::taskFunction() {
}
Class that encapsulates the functionality of a FreeRTOS task.
Definition: Task.hpp:1323
The documentation for this class was generated from the following file:
- /home/runner/work/FreeRTOS-Cpp/FreeRTOS-Cpp/FreeRTOS-Cpp/include/FreeRTOS/Semaphore.hpp