add missing file
This commit is contained in:
parent
15c572ed9a
commit
d8950c4eb4
|
@ -0,0 +1,17 @@
|
||||||
|
#pragma once
|
||||||
|
#include <freertos/semphr.h>
|
||||||
|
|
||||||
|
class GwSynchronized{
|
||||||
|
private:
|
||||||
|
SemaphoreHandle_t *locker;
|
||||||
|
public:
|
||||||
|
GwSynchronized(SemaphoreHandle_t *locker){
|
||||||
|
this->locker=locker;
|
||||||
|
xSemaphoreTake(*locker, portMAX_DELAY);
|
||||||
|
}
|
||||||
|
~GwSynchronized(){
|
||||||
|
xSemaphoreGive(*locker);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#define GWSYNCHRONIZED(locker) GwSynchronized __xlock__(locker);
|
Loading…
Reference in New Issue