2022-04-14 15:17:45 +02:00

32 lines
498 B
C++

#ifndef STA_OS2_MUTEX_HPP
#define STA_OS2_MUTEX_HPP
#include <sta/mutex.hpp>
#include <cmsis_os2.h>
namespace sta
{
/**
* @brief Implementation of `Mutex` interface using CMSIS RTOS2.
*/
class Os2Mutex : public Mutex
{
public:
/**
* @param handle CMSIS RTOS2 mutex
*/
Os2Mutex(osMutexId_t * handle);
void acquire() override;
void release() override;
private:
osMutexId_t * handle_; /**< CMSIS RTOS2 mutex */
};
} // namespace sta
#endif // STA_OS2_MUTEX_HPP