Commit Graph

41 Commits (8a0af607f3c211178b1ac2a80f281662abb1e017)

Author SHA1 Message Date
Hugues Kamba f0f408b2d8 Upstream PR #11073 review request changes (#11135)
* Modify Doxygen grouping of `drivers` Public/Internal APIs
* Correct classification of `mbed_events.h`
* Amend name of Doxygen group containing Device Key API
* Classify `CallChain.h` as public API and relocate file
* Remove Doxygen group from `equeue_platform.h` as it has no Doxygen compliant documentation
* Move USB target specific code back to `usb/device/targets`
2019-08-02 12:32:40 +01:00
Hugues Kamba 20f81e19be Change Doxygen groups structure, splitting first by Public/Internal (#11105)
* Change Doxygen groups structure, splitting first by Public/Internal

This commit also does the following:
* groups the documentation of related API
* moves `events/internal/equeue.h` to `events/equeue.h`
* merges `events/source/README.md` to `events/README.md`
2019-08-02 12:23:47 +01:00
Hugues Kamba bfa1b4dd84 Drivers/Events/RTOS Public and internal APIs cleanup (#10955)
Separate drivers, events, and rtos internal APIs from public APIs.

* Move source files to source subdirs
* Move internal headers to internal subdirs
* Add Doxygen comments for documenting internal and public APIs
* Remove source code from header files in order to remove include pre-processor directives
that included header files not directly used by said header files
* Explicitly include header files instead of implicit inclusions via third-party header files.

Release Notes

This will break user code that was using an internal API as the internal header files have been moved.
This will only break if the user was including the header file using a namespace (i.e #include "foo/bar.h" instead of #include "bar.h"
2019-08-02 12:23:47 +01:00
Filip Jagodzinski 0f3f38e512 Watchdog: Fix astyle in doxy 2019-07-04 10:49:24 +02:00
Amanda Butler ec53d1d9c8
Edit Watchdog.h
Edit file to address comments and for consistent tense and voice.
2019-07-03 17:43:51 -05:00
Filip Jagodzinski 6f8266c02f Watchdog: Clean up the doxygen comments 2019-07-03 15:28:37 +02:00
Martin Kojtal e12125bb25 Watchdog: start without arg uses max timeout from a target 2019-07-02 12:46:23 +01:00
Martin Kojtal 25fbd3956b 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-02 12:46:23 +01:00
Martin Kojtal fd445a57cb Watchdog: remove config value for timeout, set it dynamically
Use start method to set timeout
2019-07-02 12:46:23 +01:00
Martin Kojtal dc2e8ab35e 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-02 12:46:23 +01:00
Martin Kojtal ff0652830a Watchdog: fix space in code example 2019-07-02 12:46:23 +01:00
Martin Kojtal 188655f929 Watchdog: example code - add kick() 2019-07-02 12:46:23 +01:00
Martin Kojtal bb473d916e 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-02 12:46:23 +01:00
Martin Kojtal 28398e6254 Watchdog: fix include paths - use module name 2019-07-02 12:46:23 +01:00
Martin Kojtal 9f48f26876 Watchdog: fix timeout - use full range for watchdog 2019-07-02 12:46:23 +01:00
Martin Kojtal b822c09b3b Watchdog: fix callback - uses ms 2019-07-02 12:46:23 +01:00
Martin Kojtal 581bf208ad Watchdog: refactor timeout handling
Enable kicking directly by kick() and handle timeout by using private handler.
2019-07-02 12:46:23 +01:00
Martin Kojtal 0aa095b944 Watchdog: add missing docs doxygen 2019-07-02 12:46:23 +01:00
Martin Kojtal 02936376ae Watchdog: fix const static
Fixing error "non-static data member initializers only available with -std=c++11 or -std=gnu++11"
2019-07-02 12:46:23 +01:00
Filip Jagodzinski 455015daf5 Watchdog & VirtualWatchdog process() update
Add uint32 argument - pass how much time already passed to the callback.
2019-07-02 12:46:23 +01:00
Martin Kojtal b166acd1cb watchdog: fix astyle errors 2019-07-02 12:46:23 +01:00
Martin Kojtal f98c2fdbba 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-02 12:46:23 +01:00
Martin Kojtal 698b0eda8a 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-02 12:46:23 +01:00
Martin Kojtal 91679d40d5 Watchdog: cleanup after singleton usage 2019-07-02 12:46:23 +01:00
Martin Kojtal 7da2c6dbb6 Watchdog: use get_instance to access watchdog hw 2019-07-02 12:46:23 +01:00
Martin Kojtal edd857ea9c 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-02 12:46:23 +01:00
Martin Kojtal 7b0915c7d4 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-02 12:46:23 +01:00
Amanda Butler f8a6674afd Edit Watchdog.h
Edit file, mostly for active voice, consistent abbreviations, grammar and spelling.
2019-06-27 09:28:05 +01:00
Martin Kojtal e40a76575f watchdog: fix copyright 2019-06-26 09:43:21 +01:00
Rajkumar Kanagaraj dfe4b533c3 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-06-03 15:31:20 +02:00
Rajkumar Kanagaraj 696638afeb Incorporated the Reivew Comments 2019-06-03 15:24:03 +02:00
Rajkumar Kanagaraj 3c0cd62476 fix for spell check and header file 2019-06-03 15:24:01 +02:00
Rajkumar Kanagaraj f94eb3cf13 Fix for the Ci build issue 2019-06-03 15:24:01 +02:00
Rajkumar Kanagaraj 47030cd23f 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-06-03 15:23:59 +02:00
Rajkumar Kanagaraj bcea865db2 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-06-03 15:23:57 +02:00
Rajkumar Kanagaraj 3cd52d4732 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-06-03 15:23:56 +02:00
Rajkumar Kanagaraj 95e8e27e9b doxy spell check fix for watchdog 2019-05-24 12:28:23 +02:00
Donatien Garnier 91ef36809f Apply new astyle config style 2019-05-24 12:23:36 +02:00
Donatien Garnier 3ab0fbc7cf Update license headers 2019-05-24 12:23:35 +02:00
Steven Cartmell 7c392a16d4 Remove window and sleep mode options for watchdog API 2019-05-24 11:35:13 +02:00
Steven Cartmell 8fa38bb25b Add Watchdog driver API 2019-05-24 11:20:26 +02:00