Skip to content

Commit 616a4fe

Browse files
committed
Configure WiFi library watchdog feed function
1 parent 936b75c commit 616a4fe

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,11 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress,
285285
#if defined (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED)
286286
if (enable_watchdog) {
287287
watchdog_enable();
288+
#ifdef WIFI_HAS_FEED_WATCHDOG_FUNC
289+
WiFi.setFeedWatchdogFunc(watchdog_reset);
290+
#endif
288291
}
292+
289293
#endif
290294

291295
return 1;

src/utility/watchdog/Watchdog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ static void samd_watchdog_reset()
6868
* is defined a weak function there and overwritten by this "strong"
6969
* function here.
7070
*/
71+
#ifndef WIFI_HAS_FEED_WATCHDOG_FUNC
7172
void wifi_nina_feed_watchdog()
7273
{
7374
samd_watchdog_reset();
7475
}
76+
#endif
7577

7678
void mkr_gsm_feed_watchdog()
7779
{

0 commit comments

Comments
 (0)