Skip to content

Commit 67d8a2c

Browse files
committed
Add watchdog kik during downloadAndDecompress
1 parent 1afb8a2 commit 67d8a2c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/decompress/utility.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,13 @@ int Arduino_Portenta_OTA::downloadAndDecompress(const char * url, bool const is_
146146
uint32_t crc32 = 0xFFFFFFFF;
147147
uint32_t header_copied_bytes = 0;
148148
OTA_DOWNLOAD_STATE state=OTA_DOWNLOAD_HEADER;
149+
Arduino_Portenta_OTA* ref;
149150
} ota_progress;
150151

151-
int bytes = socket->download(url, is_https, [&decoder, &ota_header, &ota_progress](const char* buffer, uint32_t size) {
152+
ota_progress.ref = this;
153+
154+
int bytes = socket->download(url, is_https, [ &decoder, &ota_header, &ota_progress](const char* buffer, uint32_t size) {
155+
ota_progress.ref->feedWatchdog();
152156
for(char* cursor=(char*)buffer; cursor<buffer+size; ) {
153157
switch(ota_progress.state) {
154158
case OTA_DOWNLOAD_HEADER: {

0 commit comments

Comments
 (0)