mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-12 02:36:00 +00:00
34 lines
575 B
C++
34 lines
575 B
C++
#ifndef STA_OS2_SIGNAL_HPP
|
|
#define STA_OS2_SIGNAL_HPP
|
|
|
|
#include <sta/signal.hpp>
|
|
|
|
#include <cmsis_os2.h>
|
|
|
|
|
|
namespace sta
|
|
{
|
|
/**
|
|
* @brief Implementation of `Signal` interface using CMSIS RTOS2.
|
|
*/
|
|
class Os2Signal : public Signal
|
|
{
|
|
public:
|
|
/**
|
|
* @param semaphore CMSIS RTOS2 semaphore
|
|
*/
|
|
Os2Signal(osSemaphoreId_t * semaphore);
|
|
|
|
void notify() override;
|
|
bool peek() override;
|
|
bool test() override;
|
|
void wait() override;
|
|
|
|
private:
|
|
osSemaphoreId_t * semaphore_; /**< CMSIS RTOS2 semaphore */
|
|
};
|
|
} // namespace sta
|
|
|
|
|
|
#endif // STA_OS2_SIGNAL_HPP
|