diff --git a/src/ota/interface/OTAInterfaceDefault.cpp b/src/ota/interface/OTAInterfaceDefault.cpp index 1b0a34fd4..9e9891c85 100644 --- a/src/ota/interface/OTAInterfaceDefault.cpp +++ b/src/ota/interface/OTAInterfaceDefault.cpp @@ -94,7 +94,9 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetch() { do { if(http_client->available() == 0) { - goto exit; + /* Avoid tight loop and allow yield */ + delay(1); + continue; } http_res = http_client->read(context->buffer, context->buf_len); diff --git a/src/ota/interface/OTAInterfaceDefault.h b/src/ota/interface/OTAInterfaceDefault.h index 9e09d3cf2..95384817f 100644 --- a/src/ota/interface/OTAInterfaceDefault.h +++ b/src/ota/interface/OTAInterfaceDefault.h @@ -51,7 +51,7 @@ class OTADefaultCloudProcessInterface: public OTACloudProcessInterface { // The amount of time that each iteration of Fetch has to take at least // This mitigate the issues arising from tasks run in main loop that are using all the computing time - static constexpr uint32_t downloadTime = 100; + static constexpr uint32_t downloadTime = 2000; enum OTADownloadState: uint8_t { OtaDownloadHeader,