Avoid redundant localIP calls, each call takes 0.700 us on ESP32 240Mhz (#2206)
* Avoid redundant localIP calls, each call takes 0.700 us on ESP32 240Mhz * Fall through to check Wifi local ip if not connected to ETH * Changed local var from ipAddress to localIP to better reflect content
This commit is contained in:
@@ -591,13 +591,14 @@ void WLED::initConnection()
|
||||
|
||||
void WLED::initInterfaces()
|
||||
{
|
||||
IPAddress ipAddress = Network.localIP();
|
||||
DEBUG_PRINTLN(F("Init STA interfaces"));
|
||||
|
||||
#ifndef WLED_DISABLE_HUESYNC
|
||||
if (hueIP[0] == 0) {
|
||||
hueIP[0] = Network.localIP()[0];
|
||||
hueIP[1] = Network.localIP()[1];
|
||||
hueIP[2] = Network.localIP()[2];
|
||||
hueIP[0] = ipAddress[0];
|
||||
hueIP[1] = ipAddress[1];
|
||||
hueIP[2] = ipAddress[2];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user