22 lines
303 B
C++
22 lines
303 B
C++
/// © MiroZ 2024
|
|
|
|
#ifndef __MUTEX_H__
|
|
#define __MUTEX_H__
|
|
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <freertos/semphr.h>
|
|
|
|
class Mutex
|
|
{
|
|
protected:
|
|
SemaphoreHandle_t m_mutex = NULL;
|
|
|
|
public:
|
|
Mutex();
|
|
Mutex(SemaphoreHandle_t mutex);
|
|
|
|
bool take(uint32_t ticks = portMAX_DELAY);
|
|
bool give();
|
|
};
|
|
|
|
#endif |