File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,14 @@ class RP2040 {
314314 reboot ();
315315 }
316316
317+ void wdt_begin (uint32_t delay_ms) {
318+ watchdog_enable (delay_ms, 1 );
319+ }
320+
321+ void wdt_reset () {
322+ watchdog_update ();
323+ }
324+
317325 const char *getChipID () {
318326 static char id[PICO_UNIQUE_BOARD_ID_SIZE_BYTES + 1 ] = { 0 };
319327 if (!id[0 ]) {
Original file line number Diff line number Diff line change @@ -37,6 +37,20 @@ void rp2040.reboot()
3737~~~~~~~~~~~~~~~~~~~~
3838Forces a hardware reboot of the Pico.
3939
40+ Hardware Watchdog
41+ _________________
42+
43+ void rp2040.wdt_begin(uint32_t delay_ms)
44+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45+ Enables the hardware watchdog timer with a delay value of delay_ms
46+ microseconds. Note that on the RP2040, once this function has called, the
47+ hardware watchdog can _not_ be disabled.
48+
49+ void rp2040.wdt_reset()
50+ ~~~~~~~~~~~~~~~~
51+ Reloads the watchdog's counter with the amount of time set by wdt_begin.
52+
53+
4054Memory Information
4155------------------
4256
You can’t perform that action at this time.
0 commit comments