mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 19:26:37 +00:00
Optimize sleepdelay
This commit is contained in:
parent
d1ef1c3255
commit
5c92c5a9a9
@ -368,8 +368,7 @@ void BacklogLoop(void) {
|
|||||||
void SleepDelay(uint32_t mseconds) {
|
void SleepDelay(uint32_t mseconds) {
|
||||||
if (mseconds) {
|
if (mseconds) {
|
||||||
uint32_t wait = millis() + mseconds;
|
uint32_t wait = millis() + mseconds;
|
||||||
while (!TimeReached(wait)) {
|
while (!TimeReached(wait) && !Serial.available()) { // We need to service serial buffer ASAP as otherwise we get uart buffer overrun
|
||||||
if (Serial.available()) { return; } // We need to service serial buffer ASAP as otherwise we get uart buffer overrun
|
|
||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user