rp2040: watchdog
Implements hardware watchdog timer for RP2040.
Implementation inspired by Pico SDK It ended up quite different though.
I could not use time.Duration to have nice "period" configuration parameter instead of "ticks" due to an import loop.
Examples demonstrate basic usage, watchdog triggering on runtime panic and while spinning. Basic example added to the list of smoke tests.
This is printout from the basic example:
Hardware reset
10
9
8
7
6
5
4
3
2
1
0
Timer reset
10
9
8
7
6
Force reset
10
9
8
7
6
5
4
3
2
1
0
Timer reset
10
9
8
@ofauchon What do you think?
I've observed a strange behaviour when building with this change. Time seem to flow much slower with these changes. I've probably messed up with some timer.
This behaviour manifests itself quite remarkably: while the board is plugged in and flashed (tinygo flash) it works just fine as usual. But once you unplug the board and plug it in again (hard power cycle) you can directly tell your code runs much slower, very easy to see with blinky1 example.
Now that https://github.com/tinygo-org/tinygo/pull/3855 was merged, this PR seems obsolete, so should probably close it.
Now that #3855 was merged, this PR seems obsolete, so should probably close it.
That PR does not cover all functionality though. I'll try and rebase and sync with dev branch.
@ysoldak just noticed this PR again. What do you think about it?
@deadprogram I'll take a look. If nothing from me in a week, feel free to close it.