mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-08-07 11:27:34 +00:00
Removed system events and startup, added peek method to RtosEvent class
This commit is contained in:
@@ -40,7 +40,7 @@ namespace sta
|
||||
uint32_t get() override;
|
||||
|
||||
/**
|
||||
* @brief Wait for any of the given flags to be set.
|
||||
* @brief Wait for any of the given flags to be set. Clears the flags afterwards
|
||||
*
|
||||
* @param flags Flags to wait for.
|
||||
* @param timeout Timeout in milliseconds.
|
||||
@@ -48,9 +48,17 @@ namespace sta
|
||||
*/
|
||||
uint32_t wait(uint32_t flags, uint32_t timeout = osWaitForever) override;
|
||||
|
||||
/**
|
||||
* @brief Wait for any of the given flags to be set without clearing the flags afterwards.
|
||||
*
|
||||
* @param flags Flags to wait for.
|
||||
* @param timeout Timeout in milliseconds.
|
||||
* @return Event flags before clearing or error code if highest bit set.
|
||||
*/
|
||||
uint32_t peek(uint32_t flags, uint32_t timeout = osWaitForever) override;
|
||||
private:
|
||||
osEventFlagsId_t event_id; /**< CMSIS RTOS2 Event Flag */
|
||||
};
|
||||
} // namespace sta
|
||||
|
||||
#endif // STA_RTOS_EVENT_HPP
|
||||
#endif // STA_RTOS_EVENT_HPP
|
||||
|
@@ -1,82 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Implementation of system events.
|
||||
*/
|
||||
#ifndef STA_RTOS_SYSTEM_EVENTS_HPP
|
||||
#define STA_RTOS_SYSTEM_EVENTS_HPP
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup STA_RTOS_SysEvent System Events
|
||||
* @ingroup STA_RTOS_API
|
||||
* @brief System events.
|
||||
*
|
||||
* Check @ref STA_RTOS_BuildConfig for configuration options.
|
||||
*/
|
||||
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
// System event flags
|
||||
//
|
||||
|
||||
/**
|
||||
* @brief Startup system event flag.
|
||||
*
|
||||
* @ingroup STA_RTOS_SysEvent
|
||||
*/
|
||||
#define STA_RTOS_SYSTEM_EVENTS_STARTUP 0x100000U
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
namespace rtos
|
||||
{
|
||||
/**
|
||||
* @brief Initialize system events.
|
||||
*/
|
||||
void initSystemEvents();
|
||||
|
||||
|
||||
/**
|
||||
* @brief Signal system events.
|
||||
*
|
||||
* @param flags System event flags
|
||||
*
|
||||
* @ingroup STA_RTOS_SysEvent
|
||||
*/
|
||||
void signalSystemEvents(uint32_t flags);
|
||||
|
||||
/**
|
||||
* @brief Wait for system events.
|
||||
*
|
||||
* @param flags System event flags
|
||||
* @param options osFlagsWaitAll or osFlagsWaitAny (osFlagsNoClear always set)
|
||||
* @param timeout Wait timeout (0 = instant, osWaitForever = infinite)
|
||||
*
|
||||
* @ingroup STA_RTOS_SysEvent
|
||||
*/
|
||||
void waitForSystemEvents(uint32_t flags, uint32_t options, uint32_t timeout);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Signal startup system event.
|
||||
*
|
||||
* @ingroup STA_RTOS_SysEvent
|
||||
*/
|
||||
void signalStartupEvent();
|
||||
|
||||
/**
|
||||
* @brief Wait for startup system event.
|
||||
*
|
||||
* Blocking while waiting
|
||||
*
|
||||
* @ingroup STA_RTOS_SysEvent
|
||||
*/
|
||||
void waitForStartupEvent();
|
||||
} // namespace rtos
|
||||
} // namespace sta
|
||||
|
||||
|
||||
#endif // STA_RTOS_SYSTEM_EVENTS_HPP
|
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Implementation of startup system task.
|
||||
*/
|
||||
#ifndef STA_RTOS_SYSTEM_STARTUP_HPP
|
||||
#define STA_RTOS_SYSTEM_STARTUP_HPP
|
||||
|
||||
/**
|
||||
* @defgroup STA_RTOS_Startup RTOS Startup
|
||||
* @ingroup STA_RTOS_API
|
||||
* @brief Initializes rtos functions.
|
||||
*/
|
||||
|
||||
namespace sta
|
||||
{
|
||||
namespace rtos
|
||||
{
|
||||
/**
|
||||
* @brief Initializes rtos functions.
|
||||
*
|
||||
* @ingroup STA_RTOS_Startup
|
||||
*/
|
||||
void initSystem();
|
||||
} // namespace rtos
|
||||
} // namespace sta
|
||||
|
||||
|
||||
#endif // STA_RTOS_SYSTEM_STARTUP_HPP
|
Reference in New Issue
Block a user