Commit Graph

25527 Commits (5edea42b6f05c6401e8f93d2f6450de00db2fe6c)

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 b85fedd6d8 Watchdog: clean-up start 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 1c5097af49 Watchdog: fix dtor 2019-07-11 11:55:21 +01:00
Martin Kojtal df03c527e9 Watchdog: kick method should not have any external dep 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 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 ce51d0da87 mbed: add Watchdog and VirtualWatchdog 2019-07-11 11:55:20 +01:00
Martin Kojtal 3f96afdf4d Remove watchdog manager
Use VirtualWatchdog instead
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 1869a1d4a7 Edit ResetReason.h
Edit file for active voice, complete sentences and grammar.
2019-07-11 11:55:19 +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
Amanda Butler 5558539d55 Edit watchdog_api.h
Edit file, mostly for active voice, consistent tense and international spelling.
2019-07-11 11:55:19 +01:00
Amanda Butler 68f132f36d Edit reset_reason_api.h
Edit file, mostly for correct grammar.
2019-07-11 11:55:19 +01:00
Martin Kojtal 41434d8b08 watchdog hal: remove space 2019-07-11 11:55:19 +01:00
Martin Kojtal 92661f63a6 watchdog: fix astyle issue
Missing a space after group and before license
2019-07-11 11:55:19 +01:00
Filip Jagodzinski b50bb226fb HAL: Watchdog: Update the header file
Minor doxygen fixes.
2019-07-11 11:55:19 +01:00
Filip Jagodzinski df372fd19e ResetReason: Update the header file
Minor doxygen fixes.
2019-07-11 11:55:18 +01:00
Filip Jagodzinski 8c6d0cf9cf HAL: ResetReason: Update the header file
Add defined & undefined behavior.
Minor doxygen fixes.
2019-07-11 11:55:18 +01:00
Martin Kojtal 2a26e1af4b watchdog: fix copyright 2019-07-11 11:55:18 +01:00
Filip Jagodzinski fb55409150 HAL: Watchdog: Update the header file
Add a SPDX license identifier.
Add defined & undefined behavior.
2019-07-11 11:55:18 +01:00
Filip Jagodzinski 33ef09b3df Test: watchdog_mgr: Remove dead code 2019-07-11 11:55:18 +01:00
Filip Jagodzinski f52eca9ebe Test: update reset_reason driver test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.

Use a SERIAL_FLUSH_TIME_MS value consistent with other tests.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski 4180fcc045 Test: update HAL watchdog-timing test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski 5d76717323 Test: update HAL watchdog-reset test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
Remove explicit calls to sleep.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski e55fff9060 Test: update HAL watchdog test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski d585e1bba6 Test: update HAL reset_reason test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski 3a3bb4f90d Tests: Watchdog: Update timing test
Skip test cases with unsupported timeout values.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski d800cc315c Tests: Watchdog: Decrease default timeout to 100 ms 2019-07-11 11:55:16 +01:00
Filip Jagodzinski f163a4c8d4 Tests: Watchdog: Update test case teardown
Added a mechanism which will prevent an initialised watchdog from
resetting the device during final greentea communication.
This allows testing watchdog timeouts as short as 50 ms.
2019-07-11 11:55:16 +01:00
Filip Jagodzinski 715369d6d1 Tests: Update Watchdog Manager test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
2019-07-11 11:55:16 +01:00
Filip Jagodzinski 51835f005b Tests: ResetReason: Use the HAL watchdog API
The Watchdog driver has been updated making this test incompatible
with the new API. Use HAL API instead.
2019-07-11 11:55:16 +01:00
Filip Jagodzinski 30319b8464 Tests: Watchdog: Add Watchdog Manager tests 2019-07-11 11:55:16 +01:00
Filip Jagodzinski 5bf6842efc Tests: Watchdog: Remove outdated driver tests
The Watchdog driver has been updated making these tests incompatible
with the new API. The Watchdog driver functionality is tested with the
unit tests located in UNITTESTS/drivers/Watchdog/ .
2019-07-11 11:55:16 +01:00
Rajkumar Kanagaraj de3b843bfb Fix for Problem copying the instance from BSS to stack
-Created global instance of either LowPowerTicker or Ticker
2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 11b09a489a Fixed the unittest case failure 2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 75cc3c84cc Added the ticker support
-Modified the device dont have support of lp ticker will ticker for watchdog callback register
2019-07-11 11:55:15 +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 0a5ca29273 Incorporated the Reivew Comments 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 2959775ff0 fix for astyle 2019-07-11 11:55:14 +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 17be727821 fix: Fixing rebased created bugs 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