mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
Update ota_component.cpp (#2852)
This commit is contained in:
parent
f0bcf81a98
commit
40c017fd54
1 changed files with 4 additions and 2 deletions
|
@ -277,6 +277,7 @@ void OTAComponent::handle_() {
|
|||
ssize_t read = this->client_->read(buf, requested);
|
||||
if (read == -1) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
App.feed_wdt();
|
||||
delay(1);
|
||||
continue;
|
||||
}
|
||||
|
@ -305,8 +306,9 @@ void OTAComponent::handle_() {
|
|||
#ifdef USE_OTA_STATE_CALLBACK
|
||||
this->state_callback_.call(OTA_IN_PROGRESS, percentage, 0);
|
||||
#endif
|
||||
// slow down OTA update to avoid getting killed by task watchdog (task_wdt)
|
||||
delay(10);
|
||||
// feed watchdog and give other tasks a chance to run
|
||||
App.feed_wdt();
|
||||
yield();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue