Skip to content

Commit 0be64ae

Browse files
authored
Merge pull request #165 from pennam/ota_ret_value
UNO WiFi R4 OTA examples: fix download return value print
2 parents 87db445 + 78f2b09 commit 0be64ae

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: libraries/OTAUpdate/examples/OTA/OTA.ino

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ void setup() {
6767
Serial.println((int)ret);
6868
return;
6969
}
70-
if(ota.download(OTA_FILE_LOCATION, "/update.bin") <= 0) {
70+
int ota_size = ota.download(OTA_FILE_LOCATION, "/update.bin");
71+
if(ota_size <= 0) {
7172
Serial.println("ota.download() error: ");
72-
Serial.println((int)ret);
73+
Serial.println(ota_size);
7374
return;
7475
}
7576
ret = ota.verify();

Diff for: libraries/OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino

+3-2
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ void setup() {
7777
Serial.println((int)ret);
7878
return;
7979
}
80-
if(ota.download(OTA_FILE_LOCATION) <= 0) {
80+
int ota_size = ota.download(OTA_FILE_LOCATION);
81+
if(ota_size <= 0) {
8182
Serial.println("ota.download() error: ");
82-
Serial.println((int)ret);
83+
Serial.println(ota_size);
8384
return;
8485
}
8586
ret = ota.verify();

0 commit comments

Comments
 (0)