10#ifndef SIGNALSEMAPHORE_H
11#define SIGNALSEMAPHORE_H
28 SignalSemaphore(
const char* baseName,
const char* nameExtension =
nullptr)
noexcept;
80 const
char*
GetName() const noexcept;
C-facing helper functions for delays, cycle counters, and creation of RTOS handles (queues,...
SignalSemaphore class for managing a named semaphore.
Definition SignalSemaphore.h:21
bool Signal() noexcept
Signals the semaphore.
Definition SignalSemaphore.cpp:82
bool IsInitialized() const noexcept
Checks if the semaphore is initialized.
Definition SignalSemaphore.cpp:110
char name[MaxNameLength+1]
The name of the semaphore.
Definition SignalSemaphore.h:87
~SignalSemaphore()
Destructor for SignalSemaphore.
Definition SignalSemaphore.cpp:56
const char * GetName() const noexcept
Gets the name of the semaphore.
Definition SignalSemaphore.cpp:119
SignalSemaphore(const SignalSemaphore ©)=delete
Deleted copy constructor to avoid copying instances.
bool WaitUntilSignalled(uint32_t msecToWait=OS_WAIT_FOREVER) noexcept
Waits until the semaphore is signaled.
Definition SignalSemaphore.cpp:69
bool IsSignalled() noexcept
Checks if the semaphore is signaled.
Definition SignalSemaphore.cpp:96
static constexpr uint32_t MaxNameLength
Maximum length of the semaphore name (excluding null terminator).
Definition SignalSemaphore.h:84
OS_Semaphore semaphore
The semaphore object.
Definition SignalSemaphore.h:86
bool initialized
Indicates whether the semaphore is initialized.
Definition SignalSemaphore.h:88
SignalSemaphore & operator=(const SignalSemaphore ©)=delete
Deleted assignment operator to avoid copying instances.
bool EnsureInitialized() noexcept
Ensures the semaphore is initialized.
Definition SignalSemaphore.cpp:128
@ OS_WAIT_FOREVER
Definition os_cmsis.h:48
osSemaphoreId_t OS_Semaphore
Definition os_cmsis.h:29