35
35
#ifdef ARDUINO_ARCH_MBED
36
36
# include < watchdog_api.h>
37
37
# 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 )
39
39
#endif /* ARDUINO_ARCH_MBED */
40
40
41
41
/* *****************************************************************************
@@ -49,13 +49,13 @@ static bool is_watchdog_enabled = false;
49
49
******************************************************************************/
50
50
51
51
#ifdef ARDUINO_ARCH_SAMD
52
- void samd_watchdog_enable ()
52
+ static void samd_watchdog_enable ()
53
53
{
54
54
is_watchdog_enabled = true ;
55
55
Watchdog.enable (SAMD_WATCHDOG_MAX_TIME_ms);
56
56
}
57
57
58
- void samd_watchdog_reset ()
58
+ static void samd_watchdog_reset ()
59
59
{
60
60
if (is_watchdog_enabled) {
61
61
Watchdog.reset ();
@@ -68,10 +68,12 @@ void samd_watchdog_reset()
68
68
* is defined a weak function there and overwritten by this "strong"
69
69
* function here.
70
70
*/
71
+ #ifndef WIFI_HAS_FEED_WATCHDOG_FUNC
71
72
void wifi_nina_feed_watchdog ()
72
73
{
73
74
samd_watchdog_reset ();
74
75
}
76
+ #endif
75
77
76
78
void mkr_gsm_feed_watchdog ()
77
79
{
@@ -85,7 +87,7 @@ void mkr_nb_feed_watchdog()
85
87
#endif /* ARDUINO_ARCH_SAMD */
86
88
87
89
#ifdef ARDUINO_ARCH_MBED
88
- void mbed_watchdog_enable ()
90
+ static void mbed_watchdog_enable ()
89
91
{
90
92
watchdog_config_t cfg;
91
93
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
@@ -104,7 +106,7 @@ void mbed_watchdog_enable()
104
106
}
105
107
}
106
108
107
- void mbed_watchdog_reset ()
109
+ static void mbed_watchdog_reset ()
108
110
{
109
111
if (is_watchdog_enabled) {
110
112
hal_watchdog_kick ();
@@ -132,3 +134,23 @@ void mbed_watchdog_trigger_reset()
132
134
133
135
}
134
136
#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