Merge pull request #4233 from ascillato/patch-1

Reduce CPU usage at boot time
This commit is contained in:
Theo Arends 2018-10-31 19:49:12 +01:00 committed by GitHub
commit 5298469e7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 8 deletions

View File

@ -249,6 +249,9 @@ boolean XdrvCall(byte Function)
boolean result = false; boolean result = false;
for (byte x = 0; x < xdrv_present; x++) { for (byte x = 0; x < xdrv_present; x++) {
if (!((WL_CONNECTED == WiFi.status()) && (static_cast<uint32_t>(WiFi.localIP()) != 0))) {
delay(1);
}
result = xdrv_func_ptr[x](Function); result = xdrv_func_ptr[x](Function);
if (result) break; if (result) break;
} }

View File

@ -284,6 +284,9 @@ boolean XsnsNextCall(byte Function)
{ {
xsns_index++; xsns_index++;
if (xsns_index == xsns_present) xsns_index = 0; if (xsns_index == xsns_present) xsns_index = 0;
if (!((WL_CONNECTED == WiFi.status()) && (static_cast<uint32_t>(WiFi.localIP()) != 0))) {
delay(1);
}
return xsns_func_ptr[xsns_index](Function); return xsns_func_ptr[xsns_index](Function);
} }
@ -300,7 +303,9 @@ boolean XsnsCall(byte Function)
#ifdef PROFILE_XSNS_SENSOR_EVERY_SECOND #ifdef PROFILE_XSNS_SENSOR_EVERY_SECOND
uint32_t profile_start_millis = millis(); uint32_t profile_start_millis = millis();
#endif // PROFILE_XSNS_SENSOR_EVERY_SECOND #endif // PROFILE_XSNS_SENSOR_EVERY_SECOND
if (!((WL_CONNECTED == WiFi.status()) && (static_cast<uint32_t>(WiFi.localIP()) != 0))) {
delay(1);
}
result = xsns_func_ptr[x](Function); result = xsns_func_ptr[x](Function);
#ifdef PROFILE_XSNS_SENSOR_EVERY_SECOND #ifdef PROFILE_XSNS_SENSOR_EVERY_SECOND