Skip to content

Commit cf6593b

Browse files
authored
Merge pull request #476 from pennam/ota-block-time
OTA: increase download time to 2s
2 parents 59fff5f + b8d5305 commit cf6593b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/ota/interface/OTAInterfaceDefault.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetch() {
9494

9595
do {
9696
if(http_client->available() == 0) {
97-
goto exit;
97+
/* Avoid tight loop and allow yield */
98+
delay(1);
99+
continue;
98100
}
99101

100102
http_res = http_client->read(context->buffer, context->buf_len);

src/ota/interface/OTAInterfaceDefault.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class OTADefaultCloudProcessInterface: public OTACloudProcessInterface {
5151

5252
// The amount of time that each iteration of Fetch has to take at least
5353
// This mitigate the issues arising from tasks run in main loop that are using all the computing time
54-
static constexpr uint32_t downloadTime = 100;
54+
static constexpr uint32_t downloadTime = 2000;
5555

5656
enum OTADownloadState: uint8_t {
5757
OtaDownloadHeader,

0 commit comments

Comments
 (0)