pico-examples icon indicating copy to clipboard operation
pico-examples copied to clipboard

Update hello_watchdog to detect reboot only by watchdog

Open CorentinLemaitre opened this issue 11 months ago • 0 comments

Hello,

I have changed the hello_watchdog.c example to detect only reboot caused by watchdog.

I have used the original example program and there was a wrong detection of watchdog caused reboot. For example, when a program was load on the RP2040 through uf2 file, then the RP2040 restart and the result of watchdog_caused_reboot() is true.

I have changed it to watchdog_enable_caused_reboot() cause based on the documentation found here.

I have tested it on my own project, the detection was fine without detection of reboot caused by program upload, that is why i do a pull request to help others to use watchdog.

CorentinLemaitre avatar Mar 27 '24 11:03 CorentinLemaitre