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();
|
_xSemaphore = xSemaphoreCreateMutex();
|
||||||
EMC_SEMAPHORE_GIVE(); // release before first use
|
EMC_SEMAPHORE_GIVE(); // release before first use
|
||||||
if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) {
|
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) {
|
if (core > 1) {
|
||||||
xTaskCreate((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle);
|
xTaskCreate((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle);
|
||||||
} else {
|
} else {
|
||||||
xTaskCreatePinnedToCore((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle, core);
|
xTaskCreatePinnedToCore((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle, core);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
(void) useInternalTask;
|
(void) useInternalTask;
|
||||||
|
|||||||
@@ -154,8 +154,12 @@ class Outbox {
|
|||||||
if (!it) return;
|
if (!it) return;
|
||||||
Node* node = it._node;
|
Node* node = it._node;
|
||||||
Node* prev = it._prev;
|
Node* prev = it._prev;
|
||||||
++it;
|
Node* next = node->next;
|
||||||
|
|
||||||
_remove(prev, node);
|
_remove(prev, node);
|
||||||
|
|
||||||
|
it._prev = prev;
|
||||||
|
it._node = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove current node, current points to next
|
// remove current node, current points to next
|
||||||
|
|||||||
Reference in New Issue
Block a user