Add semaphore based signal implementation

This commit is contained in:
Henrik Stickann
2022-04-10 15:27:16 +02:00
parent 4b03e1d9f4
commit 47bad524ad
2 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#ifndef STA_OS2_SIGNAL_HPP
#define STA_OS2_SIGNAL_HPP
#include <sta/signal.hpp>
#include <cmsis_os2.h>
namespace sta
{
class Os2Signal : public Signal
{
public:
Os2Signal(osSemaphoreId_t * semaphore);
void notify() override;
bool peek() override;
bool test() override;
void wait() override;
private:
osSemaphoreId_t * semaphore_;
};
} // namespace sta
#endif // STA_OS2_SIGNAL_HPP