rtos2-utils/include/sta/os2/signal.hpp
2022-04-24 13:40:11 +02:00

37 lines
628 B
C++

/**
* @brief CMSIS RTOS2 signal implementation.
*/
#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