Skip to content

Commit e12125b

Browse files
committed
Watchdog: start without arg uses max timeout from a target
1 parent 25fbd39 commit e12125b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

drivers/Watchdog.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ bool Watchdog::start(uint32_t timeout)
4848
return _running;
4949
}
5050

51+
bool Watchdog::start()
52+
{
53+
54+
return start(get_max_timeout());
55+
}
5156

5257
bool Watchdog::stop()
5358
{

drivers/Watchdog.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ namespace mbed {
5151
*/
5252
class Watchdog : private NonCopyable<Watchdog> {
5353
public:
54-
static const uint32_t watchdog_timeout = 800;
5554

5655
/** As Watchdog might not stop ever, there is just one instance - we use single instance.
5756
* This ensures we keep Watchdog alive. To operate watchdog, use start/stop methods.
@@ -65,6 +64,16 @@ class Watchdog : private NonCopyable<Watchdog> {
6564
return instance;
6665
}
6766

67+
/** Start the watchdog timer with the maximum timeout available on a target
68+
*
69+
* Timeout is defined as get_max_timeout()
70+
*
71+
* @return status true if the watchdog timer was started
72+
* successfully. assert if one of the input parameters is out of range for the current platform.
73+
* false if watchdog timer was not started
74+
*/
75+
bool start();
76+
6877
/** Start the watchdog timer
6978
*
7079
* @param timeout Watchdog timeout
@@ -73,7 +82,7 @@ class Watchdog : private NonCopyable<Watchdog> {
7382
* successfully. assert if one of the input parameters is out of range for the current platform.
7483
* false if watchdog timer was not started
7584
*/
76-
bool start(uint32_t timeout = watchdog_timeout);
85+
bool start(uint32_t timeout);
7786

7887
/** Stops the watchdog timer
7988
*

0 commit comments

Comments
 (0)