Skip to content

Commit

Permalink
Merge pull request #476 from pennam/ota-block-time
Browse files Browse the repository at this point in the history
OTA: increase download time to 2s
  • Loading branch information
pennam authored Jun 10, 2024
2 parents 59fff5f + b8d5305 commit cf6593b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/ota/interface/OTAInterfaceDefault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/ota/interface/OTAInterfaceDefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cf6593b

Please sign in to comment.