Skip to content

Commit

Permalink
UNO WiFi R4 OTA examples: fix download return value print
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Oct 18, 2023
1 parent 87db445 commit 78f2b09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions libraries/OTAUpdate/examples/OTA/OTA.ino
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ void setup() {
Serial.println((int)ret);
return;
}
if(ota.download(OTA_FILE_LOCATION, "/update.bin") <= 0) {
int ota_size = ota.download(OTA_FILE_LOCATION, "/update.bin");
if(ota_size <= 0) {
Serial.println("ota.download() error: ");
Serial.println((int)ret);
Serial.println(ota_size);
return;
}
ret = ota.verify();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ void setup() {
Serial.println((int)ret);
return;
}
if(ota.download(OTA_FILE_LOCATION) <= 0) {
int ota_size = ota.download(OTA_FILE_LOCATION);
if(ota_size <= 0) {
Serial.println("ota.download() error: ");
Serial.println((int)ret);
Serial.println(ota_size);
return;
}
ret = ota.verify();
Expand Down

0 comments on commit 78f2b09

Please sign in to comment.