File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
src/rp2_common/hardware_watchdog Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -49,18 +49,19 @@ void _watchdog_enable(uint32_t delay_ms, bool pause_on_debug) {
49
49
hw_clear_bits (& watchdog_hw -> ctrl , dbg_bits );
50
50
}
51
51
52
- if (!delay_ms ) delay_ms = 50 ;
53
-
54
- // Note, we have x2 here as the watchdog HW currently decrements twice per tick
55
- load_value = delay_ms * 1000 * 2 ;
56
-
57
- if (load_value > 0xffffffu )
58
- load_value = 0xffffffu ;
52
+ if (!delay_ms ) {
53
+ hw_set_bits (& watchdog_hw -> ctrl , WATCHDOG_CTRL_TRIGGER_BITS );
54
+ } else {
55
+ // Note, we have x2 here as the watchdog HW currently decrements twice per tick
56
+ load_value = delay_ms * 1000 * 2 ;
59
57
58
+ if (load_value > 0xffffffu )
59
+ load_value = 0xffffffu ;
60
60
61
- watchdog_update ();
61
+ watchdog_update ();
62
62
63
- hw_set_bits (& watchdog_hw -> ctrl , WATCHDOG_CTRL_ENABLE_BITS );
63
+ hw_set_bits (& watchdog_hw -> ctrl , WATCHDOG_CTRL_ENABLE_BITS );
64
+ }
64
65
}
65
66
// end::watchdog_enable[]
66
67
You can’t perform that action at this time.
0 commit comments