Added RtosEvent peek function

This commit is contained in:
dario 2025-06-08 15:21:39 +02:00
parent 17b5566e2c
commit e75a859ac9

View File

@ -1,4 +1,6 @@
#include <sta/rtos/event.hpp> #include <sta/rtos/event.hpp>
#include <sta/debug/assert.hpp>
namespace sta { namespace sta {
RtosEvent::RtosEvent() { RtosEvent::RtosEvent() {
@ -26,8 +28,7 @@ namespace sta {
return osEventFlagsWait(event_id, flags, osFlagsWaitAny, timeout); return osEventFlagsWait(event_id, flags, osFlagsWaitAny, timeout);
} }
uint32_t RtosEvent::peek(uint32_t flags, uint32_t timeout /* = osWaitForever */) uint32_t RtosEvent::peek(uint32_t flags, uint32_t timeout /* = osWaitForever */) {
{
return osEventFlagsWait(event_id, flags, osFlagsWaitAny | osFlagsNoClear, timeout); return osEventFlagsWait(event_id, flags, osFlagsWaitAny | osFlagsNoClear, timeout);
} }