[SYS/BT] Semaphores and new BT Controller (#1819)
Add semaphore to the enqueue calls to avoid concurrency issues Add new BT controller to avoid scan evt timeout bug
This commit is contained in:
1 parent
5421f0e995
commit
eb5b8fa291
45 files changed
+380
-91
No files matched your search
@@ -105,7 +105,7 @@ void createOrUpdateDeviceLORA(const char* id, const char* model, uint8_t flags)
|
||||
void launchLORADiscovery(bool overrideDiscovery) {
|
||||
if (!overrideDiscovery && newLORADevices == 0)
|
||||
return;
|
||||
if (xSemaphoreTake(semaphorecreateOrUpdateDeviceLORA, pdMS_TO_TICKS(1000)) == pdFALSE) {
|
||||
if (xSemaphoreTake(semaphorecreateOrUpdateDeviceLORA, pdMS_TO_TICKS(QueueSemaphoreTimeOutLoop)) == pdFALSE) {
|
||||
Log.error(F("[LORA] semaphorecreateOrUpdateDeviceLORA Semaphore NOT taken" CR));
|
||||
return;
|
||||
}
|
||||
@@ -453,12 +453,11 @@ void LORAtoMQTT() {
|
||||
} else {
|
||||
LORAdataBuffer["origin"] = subjectLORAtoMQTT;
|
||||
}
|
||||
enqueueJsonObject(LORAdata);
|
||||
|
||||
handleJsonEnqueue(LORAdata);
|
||||
if (repeatLORAwMQTT) {
|
||||
Log.trace(F("Pub LORA for rpt" CR));
|
||||
LORAdata["origin"] = subjectMQTTtoLORA;
|
||||
enqueueJsonObject(LORAdata);
|
||||
handleJsonEnqueue(LORAdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user