40 lines
659 B
C++

/**
* @file
* @brief RTOS signal implementation.
*/
#ifndef STA_RTOS_SIGNAL_HPP
#define STA_RTOS_SIGNAL_HPP
#include <sta/signal.hpp>
#include <cmsis_os2.h>
namespace sta
{
/**
* @brief Implementation of Signal interface using CMSIS RTOS2.
*
* @ingroup STA_RTOS_API
*/
class RtosSignal : public Signal
{
public:
/**
* @param semaphore CMSIS RTOS2 semaphore
*/
RtosSignal(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_RTOS_SIGNAL_HPP