3535#ifdef ARDUINO_ARCH_MBED
3636# include < watchdog_api.h>
3737# define PORTENTA_H7_WATCHDOG_MAX_TIMEOUT_ms (32760 )
38- # define NANO_RP2040_WATCHDOG_MAX_TIMEOUT_ms (32760 )
38+ # define NANO_RP2040_WATCHDOG_MAX_TIMEOUT_ms (8389 )
3939#endif /* ARDUINO_ARCH_MBED */
4040
4141/* *****************************************************************************
@@ -49,13 +49,13 @@ static bool is_watchdog_enabled = false;
4949 ******************************************************************************/
5050
5151#ifdef ARDUINO_ARCH_SAMD
52- void samd_watchdog_enable ()
52+ static void samd_watchdog_enable ()
5353{
5454 is_watchdog_enabled = true ;
5555 Watchdog.enable (SAMD_WATCHDOG_MAX_TIME_ms);
5656}
5757
58- void samd_watchdog_reset ()
58+ static void samd_watchdog_reset ()
5959{
6060 if (is_watchdog_enabled) {
6161 Watchdog.reset ();
@@ -68,10 +68,12 @@ 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
7172void wifi_nina_feed_watchdog ()
7273{
7374 samd_watchdog_reset ();
7475}
76+ #endif
7577
7678void mkr_gsm_feed_watchdog ()
7779{
@@ -85,7 +87,7 @@ void mkr_nb_feed_watchdog()
8587#endif /* ARDUINO_ARCH_SAMD */
8688
8789#ifdef ARDUINO_ARCH_MBED
88- void mbed_watchdog_enable ()
90+ static void mbed_watchdog_enable ()
8991{
9092 watchdog_config_t cfg;
9193#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
@@ -104,7 +106,7 @@ void mbed_watchdog_enable()
104106 }
105107}
106108
107- void mbed_watchdog_reset ()
109+ static void mbed_watchdog_reset ()
108110{
109111 if (is_watchdog_enabled) {
110112 hal_watchdog_kick ();
@@ -132,3 +134,23 @@ void mbed_watchdog_trigger_reset()
132134
133135}
134136#endif /* ARDUINO_ARCH_MBED */
137+
138+ #if defined (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED)
139+ void watchdog_enable ()
140+ {
141+ #ifdef ARDUINO_ARCH_SAMD
142+ samd_watchdog_enable ();
143+ #else
144+ mbed_watchdog_enable ();
145+ #endif
146+ }
147+
148+ void watchdog_reset ()
149+ {
150+ #ifdef ARDUINO_ARCH_SAMD
151+ samd_watchdog_reset ();
152+ #else
153+ mbed_watchdog_reset ();
154+ #endif
155+ }
156+ #endif /* (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED) */
0 commit comments