Commit Graph

343 Commits (9f48f26876d132de6a7f060c6fa85d82b674da8b)

Author SHA1 Message Date
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 0519caebe1 VirtualWatchdog: fix doxygen docs errors 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 f7ccd06685 Watchdog: remove dead reference file 2019-07-02 12:46:23 +01:00
Martin Kojtal 1c0f1880eb VirtualWatchdog: fix error code and timeout 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 701d8f7cef 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-02 12:46:23 +01:00
Martin Kojtal a3599414e1 Watchdog: clean-up start 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 a668454de4 Watchdog: fix dtor 2019-07-02 12:46:23 +01:00
Martin Kojtal bb1cc32a25 Watchdog: kick method should not have any external dep 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 d9e12e4168 VirtualWatchdog: fix protection macro 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 c497010a56 Edit ResetReason.h
Edit file for active voice, complete sentences and grammar.
2019-06-27 09:45:32 +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
Filip Jagodzinski e2ba0bb533 ResetReason: Update the header file
Minor doxygen fixes.
2019-06-26 09:58:24 +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 e7761a1d39 Move watchdog parameter validation into the driver layer 2019-05-24 11:35:22 +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
Steven Cartmell 3c18dcb882 Amend reset reason driver API
- Change API to match C++ API throughout drivers
- Amend HAL API documentation to be more specific
2019-05-24 11:20:26 +02:00
Steven Cartmell 366893ae71 Add independent watchdog reference implementation for STM32 2019-05-24 11:20:25 +02:00
Martin Kojtal 64575fe586
Merge pull request #10480 from kjbracey-arm/spi_prime
SPI: Prime asynch transaction buffer on construction
2019-05-14 09:28:41 +01:00
Kevin Bracey 3fbad10337 SPI: Prime asynch transaction buffer on construction
SPI peripherals' asynch transaction buffers are now wrapped by
SingletonPtr, which needs to take the singleton_lock Mutex when first
accessed. If it was first accessed by an asynch transaction started from
IRQ, that would not be possible.

Add a SingletonPtr::get() call to the SPI construction process so that
the peripheral's buffer is fully constructed before any SPI methods can
be called, meaning asynch methods won't fail from IRQ.

(Other pre-existing synchronisation issues with async remain, but this
avoids a new trap in Mbed OS 5.12).
2019-04-25 17:19:01 +03:00
Martin Kojtal 8c696076fc
Merge pull request #10408 from sg-/docs-businout
Update comments and improve readability for the BusInOut class
2019-04-18 18:00:07 +01:00
Amanda Butler 04552a1409
Fix typos in BusInOut.h
Fix typos.
2019-04-17 15:12:19 -05:00
Martin Kojtal 14b9229b13
Merge pull request #10415 from 0xc0170/fix_licenses
rtos/drivers: add license information
2019-04-17 12:26:43 +01:00
Martin Kojtal 5a96f45ce0 license: fix files list 2019-04-16 11:43:14 +01:00
Martin Kojtal 5f985f56dc drivers: add license information 2019-04-16 11:29:14 +01:00
samgrove d88f2d9eed Update comments and improve readability for the BusInOut class 2019-04-15 14:58:24 -05:00
Kevin Bracey 380b27e741 Fix UARTSerial emergency unbuffered write
The length calculation in UARTSerial::write_unbuffered was wrong,
meaning it would truncate output data to half length.

This would show up if `platform.stdio-buffered-serial` was configured to
true, `platform.stdio-convert-newlines` was still false - `mbed_error`
crashes would be garbled.

This wasn't usually spotted because applications generally have both
settings false or both true, and if newline conversion is on, then
`mbed_error_puts` writes 1 character at a time to FileHandle::write,
avoiding the length error.
2019-04-09 16:15:09 +03:00
Cruz Monrreal d2c9d9ddc8
Merge pull request #9111 from embeddedteam103/can_signness_mismatch
CAN: Fix signness mismatch in `CANMessage` constructors
2019-04-01 17:06:09 -05:00