mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-08-06 11:07:34 +00:00
Add mutex implementation
This commit is contained in:
31
include/sta/os2/mutex.hpp
Normal file
31
include/sta/os2/mutex.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef STA_OS2_MUTEX_HPP
|
||||
#define STA_OS2_MUTEX_HPP
|
||||
|
||||
#include <sta/mutex.hpp>
|
||||
|
||||
#include <cmsis_os2.h>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
/**
|
||||
* @brief Implementation of Mutex for CMSIS V2.
|
||||
*/
|
||||
class Os2Mutex : public Mutex
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @param handle CMSIS V2 mutex
|
||||
*/
|
||||
Os2Mutex(osMutexId_t * handle);
|
||||
|
||||
void acquire() override;
|
||||
void release() override;
|
||||
|
||||
private:
|
||||
osMutexId_t * handle_; /**< CMSIS V2 mutex */
|
||||
};
|
||||
} // namespace sta
|
||||
|
||||
|
||||
#endif // STA_OS2_MUTEX_HPP
|
Reference in New Issue
Block a user