mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-13 05:53:06 +01:00
add missing file
This commit is contained in:
17
lib/queue/GwSynchronized.h
Normal file
17
lib/queue/GwSynchronized.h
Normal 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);
|
||||
Reference in New Issue
Block a user