Skip to content

Commit 756a64a

Browse files
committed
After the implementation of a time-out logic in the previous commit it makes sense to feed the watchdog within the main-loop body since the timeout will terminate the loop anyway.
1 parent 6b1e802 commit 756a64a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utility/ota/OTA-nano-rp2040.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ int rp2040_connect_onOTARequest(char const * ota_url)
136136
is_http_header_timeout = (millis() - start) > (10*1000);
137137
if (is_http_header_timeout) break;
138138

139+
mbed_watchdog_reset();
140+
139141
if (client->available())
140142
{
141-
mbed_watchdog_reset();
142-
143143
char const c = client->read();
144144

145145
http_header += c;
@@ -181,10 +181,10 @@ int rp2040_connect_onOTARequest(char const * ota_url)
181181
is_http_data_timeout = (millis() - start) > (60*1000);
182182
if (is_http_data_timeout) break;
183183

184+
mbed_watchdog_reset();
185+
184186
if (client->available())
185187
{
186-
mbed_watchdog_reset();
187-
188188
char const c = client->read();
189189

190190
if (fwrite(&c, 1, sizeof(c), file) != sizeof(c))

0 commit comments

Comments
 (0)