Commit Graph

38 Commits (eda75fd02a27d0d26bbed4953abb19ed778a5a8c)

Author SHA1 Message Date
Filip Jagodzinski de7896ba23 Watchdog: Fix astyle in doxy 2019-07-11 12:13:15 +01:00
Amanda Butler 27dff4aada Edit Watchdog.h
Edit file to address comments and for consistent tense and voice.
2019-07-11 12:13:02 +01:00
Filip Jagodzinski 223d6c4a9d Watchdog: Clean up the doxygen comments 2019-07-11 12:12:51 +01:00
Martin Kojtal c1c132930d Watchdog: start without arg uses max timeout from a target 2019-07-11 11:55:30 +01:00
Martin Kojtal 8de11211d7 Watchdog: remove VirtualWatchdog
We will provide documentation how to create your own VirtualWatchdog. It's simple,
create timeout and watchdog objects.

This class brought lot of discussion and questions. After our refactor we made this class
just a linked list of objects - something tickers can do as well (they already have linked list) and handling hw should be
done via Watchdog due to the limitations (timeout can be set only once per app!).
2019-07-11 11:55:29 +01:00
Martin Kojtal 8024e405f8 Watchdog: remove config value for timeout, set it dynamically
Use start method to set timeout
2019-07-11 11:55:29 +01:00
Martin Kojtal a415e44875 Watchdog: add docs update about intention one vs multiple Watchdogs
VirtualWatchdog - multiple timers in the system - most used watchdog
Watchdog - simple driver for one system timer in the app - bootloader or similar
2019-07-11 11:55:28 +01:00
Martin Kojtal c9e26ec44b Watchdog: fix space in code example 2019-07-11 11:55:27 +01:00
Martin Kojtal 0414278d80 Watchdog: example code - add kick() 2019-07-11 11:55:27 +01:00
Martin Kojtal 23af0d9f92 Watchdog: keep it simple - providing simple driver functionality
No callbacks or tickers. User is handling kick() method directly based on timeout set.
VirtualWatchdog manages ticker and callback.
2019-07-11 11:55:25 +01:00
Martin Kojtal 2fe571ec7e Watchdog: fix include paths - use module name 2019-07-11 11:55:25 +01:00
Martin Kojtal 4bcdd435ab Watchdog: fix timeout - use full range for watchdog 2019-07-11 11:55:24 +01:00
Martin Kojtal 659e5051f3 Watchdog: fix callback - uses ms 2019-07-11 11:55:24 +01:00
Martin Kojtal 17d559993b Watchdog: refactor timeout handling
Enable kicking directly by kick() and handle timeout by using private handler.
2019-07-11 11:55:24 +01:00
Martin Kojtal d0be8e4543 Watchdog: add missing docs doxygen 2019-07-11 11:55:23 +01:00
Martin Kojtal 885332bef3 Watchdog: fix const static
Fixing error "non-static data member initializers only available with -std=c++11 or -std=gnu++11"
2019-07-11 11:55:22 +01:00
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 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 f0c050dace Watchdog: cleanup after singleton usage 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
Martin Kojtal cd8ac1e132 Watchdog: refactor driver
Watchdog is hardware driver. It interacts with HAL - provides wrapper to interact with the peripheral.

Provides basic functionality: start/stop, get timeout/max timeout.
It is automatically kicked by a timer, according to the timeout set in ctor.
2019-07-11 11:55:20 +01:00
Amanda Butler aa9941805c Edit Watchdog.h
Edit file, mostly for active voice, consistent abbreviations, grammar and spelling.
2019-07-11 11:55:19 +01:00
Martin Kojtal 2a26e1af4b watchdog: fix copyright 2019-07-11 11:55:18 +01:00
Rajkumar Kanagaraj 5150b37aea Update Watchdog
- Changed the process into static method
 - used the singletonptr for creating the low power ticker instance
 - Added the mbed stub into cmake build for cellularnonipsocket,loramacrypto
2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 7cdbc3dccf Incorporated the Reivew Comments 2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 19e22a0e3c fix for spell check and header file 2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj a644886d5d Fix for the Ci build issue 2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj 16b340ea60 SW watchdog unittest cases
-Added the mock class function to mock mbed_assert_internal
  -Added the unit test case to test start,kick,stop
  -Modified the interface api name from is_alive to process
  -added the unit test cases for process
2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj 02b319f3c7 Add SW Watchdog
-SW watchdog has interface name start(),stop(),kick()	Sw watchdog internally has static list and shared across multiple instance of SW watchdog
	- Sw watchdog initialize timeout value,unique string via constructor whenever threads created sw watchdog object
	-Threads make sure pass proper timeout value,Unique string while creating the instance.
	-start() called by components(BLE,WIFI etc.,),it adds the entry into static list with few details current count ,etc.,
	-kick() called by registered components(BLE,WIFI etc.) to reset current count to zero.
        -is_alive - interface API to mbed_watchdog_manager
        -implementation optimization
2019-07-11 11:55:13 +01:00
Rajkumar Kanagaraj bb9ccb8f47 Watchdog refactoring to multithreaded thread.
-Added API to register muliple threads to watchdog drivers
-Watchdog timeout reconfigures everytime whenever new register thread with longer timeout period
-New APIs for watchdog
 wd_register(const osThreadId_t tid, const uint32_t timeout) to register to watchdog
 wd_unregister(const osThreadId_t tid) to unregister to watchdog
 kick(const osThreadId_t tid) to refresh the watchdog
2019-07-11 11:55:13 +01:00
Rajkumar Kanagaraj 9ed124707d doxy spell check fix for watchdog 2019-07-11 11:55:11 +01:00
Donatien Garnier fd7e46b799 Apply new astyle config style 2019-07-11 11:55:09 +01:00
Donatien Garnier 7c05a83afa Update license headers 2019-07-11 11:55:09 +01:00
Steven Cartmell 0128edd996 Remove window and sleep mode options for watchdog API 2019-07-11 11:55:04 +01:00
Steven Cartmell 0a140b97d8 Add Watchdog driver API 2019-07-11 11:55:03 +01:00