mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-31 22:47:44 +00:00
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
|
delay(sleep); // https://github.com/esp8266/Arduino/issues/2021
|
||||||
|
|
||||||
uint32_t my_activity = millis() - my_sleep;
|
uint32_t my_activity = millis() - my_sleep;
|
||||||
if (global_state.wifi_down) {
|
if (my_activity < (uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]) {
|
||||||
delay(my_activity /2); // Force max of 50% processing vs. yield time while wifi is down
|
delay((uint32_t)Settings.param[P_LOOP_SLEEP_DELAY] - my_activity); // Provide time for background tasks like wifi
|
||||||
} else {
|
} else {
|
||||||
if (my_activity < (uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]) {
|
if (global_state.wifi_down) {
|
||||||
delay((uint32_t)Settings.param[P_LOOP_SLEEP_DELAY] - my_activity); // Provide time for background tasks like wifi
|
delay(my_activity /2); // If wifi down and my_activity > setoption36 then force loop delay to 1/3 of my_activity period
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user