File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
targets/TARGET_RASPBERRYPI/TARGET_RP2040 Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
#if DEVICE_WATCHDOG
6
6
7
+ static watchdog_config_t watchdogConfig ;
8
+
7
9
watchdog_status_t hal_watchdog_init (const watchdog_config_t * config )
8
10
{
11
+ watchdogConfig = * config ;
9
12
// The pico watchdogs accept a maximum value of 0x7fffff
10
13
if ( config -> timeout_ms < 0x1 && config -> timeout_ms > 0x7FFFFF ) {
11
14
return WATCHDOG_STATUS_INVALID_ARGUMENT ;
@@ -29,7 +32,11 @@ watchdog_status_t hal_watchdog_stop(void)
29
32
30
33
uint32_t hal_watchdog_get_reload_value (void )
31
34
{
32
- return (watchdog_hw -> load / 2000U );
35
+ uint32_t load_value = watchdogConfig .timeout_ms * 1000 * 2 ;
36
+ if (load_value > 0xffffffu ) {
37
+ load_value = 0xffffffu ;
38
+ }
39
+ return load_value ;
33
40
}
34
41
35
42
watchdog_features_t hal_watchdog_get_platform_features (void )
You can’t perform that action at this time.
0 commit comments