mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 21:01:25 +01:00
make task startup nicer
This commit is contained in:
parent
4901f12fcd
commit
877db433a4
@ -143,17 +143,25 @@ bool WifiESP::setup(const char *SSid,
|
||||
}
|
||||
server = new WiFiServer(port); // start listening on tcp port
|
||||
server->begin();
|
||||
DIAG(F("Server up port %d"),port);
|
||||
// server started here
|
||||
|
||||
xTaskCreatePinnedToCore(wifiLoop, /* Task function. */
|
||||
"wifiLoop",/* name of task. */
|
||||
10000, /* Stack size of task */
|
||||
NULL, /* parameter of the task */
|
||||
1, /* priority of the task */
|
||||
NULL, /* Task handle to keep track of created task */
|
||||
0); /* pin task to core 0 */
|
||||
//start loop task
|
||||
if (pdPASS != xTaskCreatePinnedToCore(
|
||||
wifiLoop, /* Task function. */
|
||||
"wifiLoop",/* name of task. */
|
||||
10000, /* Stack size of task */
|
||||
NULL, /* parameter of the task */
|
||||
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 false;
|
||||
}
|
||||
|
||||
void WifiESP::loop() {
|
||||
|
Loading…
Reference in New Issue
Block a user