mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 13:07:03 +03:00
more fixes
This commit is contained in:
@@ -26,8 +26,8 @@ namespace bell
|
|||||||
this->core = core;
|
this->core = core;
|
||||||
this->runOnPSRAM = runOnPSRAM;
|
this->runOnPSRAM = runOnPSRAM;
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
this->priority = ESP_TASK_PRIO_MIN + 1 + priority;
|
this->priority = CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT + priority;
|
||||||
if (this->priority < 0) this->priority = ESP_TASK_PRIO_MIN + 1;
|
if (this->priority < 0) this->priority = ESP_TASK_PRIO_MIN;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
virtual ~Task() {}
|
virtual ~Task() {}
|
||||||
@@ -37,11 +37,10 @@ namespace bell
|
|||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
if (runOnPSRAM)
|
if (runOnPSRAM)
|
||||||
{
|
{
|
||||||
|
|
||||||
xTaskBuffer = (StaticTask_t *)heap_caps_malloc(sizeof(StaticTask_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
xTaskBuffer = (StaticTask_t *)heap_caps_malloc(sizeof(StaticTask_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
||||||
xStack = (StackType_t *)heap_caps_malloc(this->stackSize, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
xStack = (StackType_t *)heap_caps_malloc(this->stackSize, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||||
|
|
||||||
return (xTaskCreateStaticPinnedToCore(taskEntryFuncPSRAM, this->taskName.c_str(), this->stackSize, this, 2, xStack, xTaskBuffer, this->core) != NULL);
|
return (xTaskCreateStaticPinnedToCore(taskEntryFuncPSRAM, this->taskName.c_str(), this->stackSize, this, this->priority, xStack, xTaskBuffer, this->core) != NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -50,7 +49,7 @@ namespace bell
|
|||||||
cfg.inherit_cfg = true;
|
cfg.inherit_cfg = true;
|
||||||
cfg.thread_name = this->taskName.c_str();
|
cfg.thread_name = this->taskName.c_str();
|
||||||
cfg.pin_to_core = core;
|
cfg.pin_to_core = core;
|
||||||
cfg.prio = priority;
|
cfg.prio = this->priority;
|
||||||
esp_pthread_set_cfg(&cfg);
|
esp_pthread_set_cfg(&cfg);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -164,6 +164,8 @@ size_t PlainConnection::writeBlock(const std::vector<uint8_t> &data)
|
|||||||
|
|
||||||
void PlainConnection::closeSocket()
|
void PlainConnection::closeSocket()
|
||||||
{
|
{
|
||||||
|
if (this->apSock < 0) return;
|
||||||
|
|
||||||
CSPOT_LOG(info, "Closing socket...");
|
CSPOT_LOG(info, "Closing socket...");
|
||||||
shutdown(this->apSock, SHUT_RDWR);
|
shutdown(this->apSock, SHUT_RDWR);
|
||||||
close(this->apSock);
|
close(this->apSock);
|
||||||
|
|||||||
Reference in New Issue
Block a user