mirror of https://github.com/arendst/Tasmota.git
Merge pull request #4410 from andrethomas/patch-1
Update boot delay code
This commit is contained in:
commit
9ec57e0203
|
@ -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
|
||||
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 (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
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue