add missing file

This commit is contained in:
wellenvogel 2021-12-01 21:01:19 +01:00
parent 15c572ed9a
commit d8950c4eb4
1 changed files with 17 additions and 0 deletions

View File

@ -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);