migrate espMqttClient upsteam patches

This commit is contained in:
proddy
2026-07-26 17:39:58 +02:00
parent 454b45ee65
commit aa8481c42e
2 changed files with 10 additions and 1 deletions

View File

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

View File

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