38
38
# define NANO_RP2040_WATCHDOG_MAX_TIMEOUT_ms (32760 )
39
39
#endif /* ARDUINO_ARCH_MBED */
40
40
41
+ #if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
42
+ # include < WiFiNINA.h>
43
+ #endif
44
+
41
45
/* *****************************************************************************
42
46
* GLOBAL VARIABLES
43
47
******************************************************************************/
@@ -53,6 +57,14 @@ void samd_watchdog_enable()
53
57
{
54
58
is_watchdog_enabled = true ;
55
59
Watchdog.enable (SAMD_WATCHDOG_MAX_TIME_ms);
60
+ #if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT)
61
+ /* This function is called within the WiFiNINA library when invoking
62
+ * the method 'connectBearSSL' in order to prevent a premature bite
63
+ * of the watchdog (max timeout on SAMD is 16 s) as well as during various
64
+ * calls to 'begin'.
65
+ */
66
+ WiFi.setFeedWatchdogFunc (samd_watchdog_reset);
67
+ #endif
56
68
}
57
69
58
70
void samd_watchdog_reset ()
@@ -62,17 +74,6 @@ void samd_watchdog_reset()
62
74
}
63
75
}
64
76
65
- /* This function is called within the WiFiNINA library when invoking
66
- * the method 'connectBearSSL' in order to prevent a premature bite
67
- * of the watchdog (max timeout on SAMD is 16 s). wifi_nina_feed...
68
- * is defined a weak function there and overwritten by this "strong"
69
- * function here.
70
- */
71
- void wifi_nina_feed_watchdog ()
72
- {
73
- samd_watchdog_reset ();
74
- }
75
-
76
77
void mkr_gsm_feed_watchdog ()
77
78
{
78
79
samd_watchdog_reset ();
@@ -100,8 +101,12 @@ void mbed_watchdog_enable()
100
101
is_watchdog_enabled = true ;
101
102
}
102
103
else {
103
- DEBUG_WARNING (" %s: watchdog could not be enabled" , __FUNCTION__);
104
+ DEBUG_ERROR (" %s: watchdog could not be enabled" , __FUNCTION__);
104
105
}
106
+
107
+ #if defined(ARDUINO_NANO_RP2040_CONNECT)
108
+ WiFi.setFeedWatchdogFunc (mbed_watchdog_reset);
109
+ #endif
105
110
}
106
111
107
112
void mbed_watchdog_reset ()
0 commit comments