mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 15:38:11 +01:00
Feed watchdog while setting up OTA (#2876)
This commit is contained in:
parent
3c0c514e44
commit
e763469af8
1 changed files with 4 additions and 0 deletions
|
@ -372,6 +372,7 @@ bool OTAComponent::readall_(uint8_t *buf, size_t len) {
|
||||||
ssize_t read = this->client_->read(buf + at, len - at);
|
ssize_t read = this->client_->read(buf + at, len - at);
|
||||||
if (read == -1) {
|
if (read == -1) {
|
||||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||||
|
App.feed_wdt();
|
||||||
delay(1);
|
delay(1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -383,6 +384,7 @@ bool OTAComponent::readall_(uint8_t *buf, size_t len) {
|
||||||
} else {
|
} else {
|
||||||
at += read;
|
at += read;
|
||||||
}
|
}
|
||||||
|
App.feed_wdt();
|
||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,6 +403,7 @@ bool OTAComponent::writeall_(const uint8_t *buf, size_t len) {
|
||||||
ssize_t written = this->client_->write(buf + at, len - at);
|
ssize_t written = this->client_->write(buf + at, len - at);
|
||||||
if (written == -1) {
|
if (written == -1) {
|
||||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||||
|
App.feed_wdt();
|
||||||
delay(1);
|
delay(1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -409,6 +412,7 @@ bool OTAComponent::writeall_(const uint8_t *buf, size_t len) {
|
||||||
} else {
|
} else {
|
||||||
at += written;
|
at += written;
|
||||||
}
|
}
|
||||||
|
App.feed_wdt();
|
||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue