mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-14 06:23:07 +01:00
directly use SemaphoreHandle_t as pointer
This commit is contained in:
@@ -156,11 +156,11 @@ class ExampleWebData{
|
||||
vSemaphoreDelete(lock);
|
||||
}
|
||||
void set(int v){
|
||||
GWSYNCHRONIZED(&lock);
|
||||
GWSYNCHRONIZED(lock);
|
||||
data=v;
|
||||
}
|
||||
int get(){
|
||||
GWSYNCHRONIZED(&lock);
|
||||
GWSYNCHRONIZED(lock);
|
||||
return data;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -246,7 +246,7 @@ void GwTcpClient::resolveHost(String host)
|
||||
{
|
||||
LOG_DEBUG(GwLog::LOG,"start resolving %s",host.c_str());
|
||||
{
|
||||
GWSYNCHRONIZED(&locker);
|
||||
GWSYNCHRONIZED(locker);
|
||||
resolvedAddress.resolved = false;
|
||||
}
|
||||
state = C_RESOLVING;
|
||||
@@ -283,12 +283,12 @@ void GwTcpClient::resolveHost(String host)
|
||||
void GwTcpClient::setResolved(IPAddress addr, bool valid){
|
||||
LOG_DEBUG(GwLog::LOG,"setResolved %s, valid=%s",
|
||||
addr.toString().c_str(),(valid?"true":"false"));
|
||||
GWSYNCHRONIZED(&locker);
|
||||
GWSYNCHRONIZED(locker);
|
||||
resolvedAddress.address=addr;
|
||||
resolvedAddress.resolved=valid;
|
||||
state=C_RESOLVED;
|
||||
}
|
||||
GwTcpClient::ResolvedAddress GwTcpClient::getResolved(){
|
||||
GWSYNCHRONIZED(&locker);
|
||||
GWSYNCHRONIZED(locker);
|
||||
return resolvedAddress;
|
||||
}
|
||||
@@ -38,13 +38,14 @@ class TaskInterfacesStorage;
|
||||
class GwUserCode{
|
||||
GwLog *logger;
|
||||
GwApiInternal *api;
|
||||
SemaphoreHandle_t *mainLock;
|
||||
SemaphoreHandle_t mainLock=nullptr;
|
||||
TaskInterfacesStorage *taskData;
|
||||
void startAddOnTask(GwApiInternal *api,GwUserTask *task,int sourceId,String name);
|
||||
public:
|
||||
~GwUserCode();
|
||||
typedef std::map<String,String> Capabilities;
|
||||
GwUserCode(GwApiInternal *api, SemaphoreHandle_t *mainLock);
|
||||
GwUserCode(GwApiInternal *api);
|
||||
void begin(SemaphoreHandle_t mainLock){this->mainLock=mainLock;}
|
||||
void startUserTasks(int baseId);
|
||||
void startInitTasks(int baseId);
|
||||
void startAddonTask(String name,TaskFunction_t task, int id);
|
||||
|
||||
Reference in New Issue
Block a user