Commit Graph

8 Commits (01490b555dd10362416a8ec838727b24b31ad076)

Author SHA1 Message Date
Filip Jagodzinski 01490b555d Watchdog & VirtualWatchdog process() update
Add uint32 argument - pass how much time already passed to the callback.
2019-07-11 11:55:22 +01:00
Martin Kojtal cfcad68255 VirtualWatchdog: make sure we are the only owner of watchdog
If virtual one is not the only owner we error - init error code in driver.
2019-07-11 11:55:22 +01:00
Martin Kojtal 1624b9d17f watchdog: fix astyle errors 2019-07-11 11:55:21 +01:00
Martin Kojtal 33f3587377 watchdog: remove manager
Watchdog can handle callbacks - VirtualManager can attach to the tick. This should simplify the logic.

Watchdog can tick on its own using tickers.
VirtualWatchdog uses attach to get a callback when Watchdog ticks - to process own
linked list of virtual watchdogs.
2019-07-11 11:55:21 +01:00
Martin Kojtal c97f95817c watchdog: add WatchdogManager
Watchdog should be usable on it's own - kicking it via ticker. No Virtual involved.
VirtualWatchdog as well - services should use this one to have multiple one in the system.

There's WatchdogManager - basically internal class to manage ticker for Watchdog.
2019-07-11 11:55:21 +01:00
Martin Kojtal 17470b8a74 VirtualWatchdog: fix protection macro 2019-07-11 11:55:20 +01:00
Martin Kojtal 6ab79c93d4 Watchdog: use get_instance to access watchdog hw 2019-07-11 11:55:20 +01:00
Martin Kojtal d7cba43afd VirtualWatchdog: software watchdog
Refactor old Watchdog (it was not a driver) to become VirtualWatchdog.
This is software virtual watchdog. This it the primary used watchdog in user application.

VirtualWatchdog: has-a watchdog. Initializes hw watchdog - start it when first used, stops it when there is no more VirtualWatchdog in the system -
list is empty.

Adding also check to watchdog to make sure there is only one in the system - runtime error if multiple objects created to already
running hw watchdog.
2019-07-11 11:55:20 +01:00