mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-08-06 19:17:34 +00:00
Add system events handling
This commit is contained in:
32
src/system_event.cpp
Normal file
32
src/system_event.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <sta/system_event.hpp>
|
||||
|
||||
#include <cmsis_os2.h>
|
||||
|
||||
|
||||
extern osEventFlagsId_t systemEventHandle;
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
void signalSystemEvents(uint32_t flags)
|
||||
{
|
||||
osEventFlagsSet(systemEventHandle, flags);
|
||||
}
|
||||
|
||||
|
||||
void waitForSystemEvents(uint32_t flags, uint32_t options, uint32_t timeout)
|
||||
{
|
||||
osEventFlagsWait(systemEventHandle, flags, options | osFlagsNoClear, timeout);
|
||||
}
|
||||
|
||||
|
||||
void signalStartupCompleted()
|
||||
{
|
||||
signalSystemEvents(STA_SYSTEM_EVENT_STARTUP);
|
||||
}
|
||||
|
||||
void waitForStartup()
|
||||
{
|
||||
waitForSystemEvents(STA_SYSTEM_EVENT_STARTUP, osFlagsWaitAll, osWaitForever);
|
||||
}
|
||||
} // namespace sta
|
Reference in New Issue
Block a user