mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-07-29 01:52:51 +00:00
migrate espMqttClient upsteam patches
This commit is contained in:
@@ -62,11 +62,16 @@ MqttClient::MqttClient(espMqttClientTypes::UseInternalTask useInternalTask, uint
|
||||
_xSemaphore = xSemaphoreCreateMutex();
|
||||
EMC_SEMAPHORE_GIVE(); // release before first use
|
||||
if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) {
|
||||
#ifdef CONFIG_FREERTOS_UNICORE
|
||||
// no core to pin to on single-core targets (S2, C3, C6)
|
||||
xTaskCreate((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle);
|
||||
#else
|
||||
if (core > 1) {
|
||||
xTaskCreate((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle);
|
||||
} else {
|
||||
xTaskCreatePinnedToCore((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle, core);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
(void) useInternalTask;
|
||||
|
||||
@@ -154,8 +154,12 @@ class Outbox {
|
||||
if (!it) return;
|
||||
Node* node = it._node;
|
||||
Node* prev = it._prev;
|
||||
++it;
|
||||
Node* next = node->next;
|
||||
|
||||
_remove(prev, node);
|
||||
|
||||
it._prev = prev;
|
||||
it._node = next;
|
||||
}
|
||||
|
||||
// remove current node, current points to next
|
||||
|
||||
Reference in New Issue
Block a user