mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-10 01:55:59 +00:00
Additional constructor for rtos signal
This commit is contained in:
parent
c1ee6464df
commit
341f36ef9d
@ -25,6 +25,8 @@ namespace sta
|
||||
*/
|
||||
RtosSignal(osSemaphoreId_t semaphore);
|
||||
|
||||
RtosSignal(uint32_t max, uint32_t initial = 0);
|
||||
|
||||
/**
|
||||
* @brief Notify the signal.
|
||||
*/
|
||||
|
@ -1,11 +1,21 @@
|
||||
#include <sta/rtos/signal.hpp>
|
||||
|
||||
#include <sta/debug/assert.hpp>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
RtosSignal::RtosSignal(osSemaphoreId_t semaphore)
|
||||
: semaphore_{semaphore}
|
||||
{}
|
||||
{
|
||||
STA_ASSERT(semaphore != NULL);
|
||||
}
|
||||
|
||||
RtosSignal::RtosSignal(uint32_t max, uint32_t initial /* = 0 */)
|
||||
: semaphore_{osSemaphoreNew(max, initial, NULL)}
|
||||
{
|
||||
STA_ASSERT(semaphore_ != NULL);
|
||||
}
|
||||
|
||||
void RtosSignal::notify()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user