Skip to content

Commit

Permalink
Quick fix for mqtt setup being broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhampuswall committed Jan 2, 2025
1 parent d554701 commit d2859dc
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions firmware/src/network/wifi_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,27 +243,30 @@ void WifiTask::webHandlerWiFiCredentials()

server_->send(200, "application/json", response);

auto taskLambda = []()
if (strcmp(redirect_page, "spotify") == 0)
{
delay(400);
WiFi.softAPdisconnect();
vTaskDelete(NULL);
};

xTaskCreatePinnedToCore(
[](void *taskFunc)
auto taskLambda = []()
{
auto func = static_cast<std::function<void()> *>(taskFunc);
(*func)();
delete func;
delay(200);
WiFi.softAPdisconnect();
vTaskDelete(NULL);
},
"disconnect_ap",
1024 * 2,
new std::function<void()>(taskLambda),
0,
NULL,
0);
};

xTaskCreatePinnedToCore(
[](void *taskFunc)
{
auto func = static_cast<std::function<void()> *>(taskFunc);
(*func)();
delete func;
vTaskDelete(NULL);
},
"disconnect_ap",
1024 * 2,
new std::function<void()>(taskLambda),
0,
NULL,
0);
}
}
else
{
Expand Down

0 comments on commit d2859dc

Please sign in to comment.