|
#ifndef MUTEX_HPP
|
|
#define MUTEX_HPP
|
|
|
|
#include <functional>
|
|
#include "Arduino.h"
|
|
#include "freertos/semphr.h"
|
|
|
|
class Mutex {
|
|
SemaphoreHandle_t _mutex;
|
|
public:
|
|
Mutex();
|
|
bool taken();
|
|
bool acquire();
|
|
void release();
|
|
bool run(std::function<void()> f, bool blocking=false);
|
|
};
|
|
|
|
#endif |