Update boot delay code

Since the driver boot delay has been removed, this is a better strategy for getting a smoother boot cpu cycle vs loop delay.
This commit is contained in:
andrethomas 2018-11-22 17:13:55 +02:00 committed by GitHub
parent 6c87ab205a
commit c436ed5d3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -2778,11 +2778,11 @@ void loop(void)
delay(sleep); // https://github.com/esp8266/Arduino/issues/2021
uint32_t my_activity = millis() - my_sleep;
if (global_state.wifi_down) {
delay(my_activity /2); // Force max of 50% processing vs. yield time while wifi is down
} else {
if (my_activity < (uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]) {
delay((uint32_t)Settings.param[P_LOOP_SLEEP_DELAY] - my_activity); // Provide time for background tasks like wifi
} else {
if (global_state.wifi_down) {
delay(my_activity /2); // If wifi down and my_activity > setoption36 then force loop delay to 1/3 of my_activity period
}
}
}