1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-01-11 13:21:01 +01:00

make own task on core0 for WifiESP::loop() on ESP32

This commit is contained in:
Harald Barth 2021-11-06 02:40:49 +01:00
parent 836ccc143e
commit 4901f12fcd
2 changed files with 15 additions and 1 deletions

View File

@ -124,7 +124,8 @@ void loop()
#if WIFI_ON
#ifndef ESP_FAMILY
WifiInterface::loop();
#else
#endif
#if defined(ARDUINO_ARCH_ESP8266) // on ESP32 own task
WifiESP::loop();
#endif
#endif //WIFI_ON

View File

@ -69,6 +69,12 @@ static WiFiServer *server = NULL;
static RingStream *outboundRing = new RingStream(2048);
static bool APmode = false;
void wifiLoop(void *){
for(;;){
WifiESP::loop();
}
}
bool WifiESP::setup(const char *SSid,
const char *password,
const char *hostname,
@ -139,6 +145,13 @@ bool WifiESP::setup(const char *SSid,
server->begin();
DIAG(F("Server up port %d"),port);
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 */
return true;
return false;
}