Skip to content

Commit 94cebe8

Browse files
committed
Fix build for Nano RP2040 connect
This board is an mbed platform + WiFiNINA so needs special handling for watchdog network feed.
1 parent c6a12f6 commit 94cebe8

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

Diff for: src/ArduinoIoTCloudTCP.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,12 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress,
307307
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
308308
if (enable_watchdog) {
309309
watchdog_enable();
310-
#if defined (WIFI_HAS_FEED_WATCHDOG_FUNC) || defined (ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC)
311310
#ifdef BOARD_HAS_ETHERNET
312311
bool const use_ethernet = _connection->getInterface() == NetworkAdapter::ETHERNET ? true : false;
313312
#else
314313
bool const use_ethernet = false;
315314
#endif
316315
watchdog_enable_network_feed(use_ethernet);
317-
#endif
318316
}
319317
#endif
320318

Diff for: src/utility/watchdog/Watchdog.cpp

+5-12
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ static void samd_watchdog_reset()
6565
}
6666
}
6767

68-
#if defined (WIFI_HAS_FEED_WATCHDOG_FUNC)
69-
static void samd_watchdog_enable_network_feed()
70-
{
71-
WiFi.setFeedWatchdogFunc(watchdog_reset);
72-
}
73-
#endif
74-
7568
/* This function is called within the WiFiNINA library when invoking
7669
* the method 'connectBearSSL' in order to prevent a premature bite
7770
* of the watchdog (max timeout on SAMD is 16 s). wifi_nina_feed...
@@ -177,14 +170,14 @@ void watchdog_reset()
177170
#endif
178171
}
179172

180-
#if defined (WIFI_HAS_FEED_WATCHDOG_FUNC) || defined (ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC)
181173
void watchdog_enable_network_feed(const bool use_ethernet)
182174
{
183-
#ifdef ARDUINO_ARCH_SAMD
184-
samd_watchdog_enable_network_feed();
185-
#else
175+
#ifdef WIFI_HAS_FEED_WATCHDOG_FUNC
176+
WiFi.setFeedWatchdogFunc(watchdog_reset);
177+
#endif
178+
179+
#ifdef ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC
186180
mbed_watchdog_enable_network_feed(use_ethernet);
187181
#endif
188182
}
189-
#endif
190183
#endif /* (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED) */

0 commit comments

Comments
 (0)