1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 21:21:24 +01:00

make task startup nicer

This commit is contained in:
Harald Barth 2021-11-06 02:59:57 +01:00
parent 4901f12fcd
commit 877db433a4

View File

@ -143,17 +143,25 @@ bool WifiESP::setup(const char *SSid,
} }
server = new WiFiServer(port); // start listening on tcp port server = new WiFiServer(port); // start listening on tcp port
server->begin(); server->begin();
DIAG(F("Server up port %d"),port); // server started here
xTaskCreatePinnedToCore(wifiLoop, /* Task function. */ //start loop task
"wifiLoop",/* name of task. */ if (pdPASS != xTaskCreatePinnedToCore(
10000, /* Stack size of task */ wifiLoop, /* Task function. */
NULL, /* parameter of the task */ "wifiLoop",/* name of task. */
1, /* priority of the task */ 10000, /* Stack size of task */
NULL, /* Task handle to keep track of created task */ NULL, /* parameter of the task */
0); /* pin task to core 0 */ 1, /* priority of the task */
NULL, /* Task handle to keep track of created task */
0)) { /* pin task to core 0 */
DIAG(F("Could not create wifiLoop task"));
return false;
}
// report server started after wifiLoop creation
// when everything looks good
DIAG(F("Server up port %d"),port);
return true; return true;
return false;
} }
void WifiESP::loop() { void WifiESP::loop() {