WDT_T4
WDT_T4 copied to clipboard
Probably incorrect timings in example 3
According to https://github.com/tonton81/WDT_T4/blob/1910b57d24468cd3419959118a2e1e6192f5e7fa/examples/watchdog3_demo/watchdog3_demo.ino#L14-L15, the timeout and window parameters are set in seconds.
But in the loop() function, the calculations are done using millis()
, hence, in milliseconds: https://github.com/tonton81/WDT_T4/blob/1910b57d24468cd3419959118a2e1e6192f5e7fa/examples/watchdog3_demo/watchdog3_demo.ino#L23-L30
So the watchdog is fed every 12 seconds (12000 milliseconds), but its window is set to 3000 seconds and timeout is set to 10000 seconds.
It's either that, or the comments incorrectly say that the timeout is in seconds (should be milliseconds).
Based on the source code, I presume it's the latter option (timeout is actually in milliseconds).
I first posted that the example was wrong. I was the one who was wrong. The example is correct, it seems to need the value in milliseconds. But, it doesn't say that, it claims seconds. If you use a value of 20000 then you will get a timeout in 20 seconds. Likewise, 10000 gives a 10 second timeout. I have tested this.