Skip to content

Commit 8024e40

Browse files
committed
Watchdog: remove config value for timeout, set it dynamically
Use start method to set timeout
1 parent 66a195c commit 8024e40

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

UNITTESTS/drivers/Watchdog/test_watchdog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ TEST_F(TestWatchdog, test_watchdog_get_max_timeout)
6363

6464
TEST_F(TestWatchdog, test_watchdog_get_timeout)
6565
{
66-
EXPECT_EQ(500, Watchdog::get_instance().get_timeout());
66+
EXPECT_EQ(Watchdog::watchdog_timeout, Watchdog::get_instance().get_timeout());
6767
}
6868

UNITTESTS/drivers/Watchdog/unittest.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ set(unittest-test-sources
2424
)
2525

2626
# defines
27-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1 -DMBED_CONF_TARGET_WATCHDOG_TIMEOUT=500")
28-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1 -DMBED_CONF_TARGET_WATCHDOG_TIMEOUT=500")
27+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1")
28+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1")

drivers/Watchdog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace mbed {
5151
*/
5252
class Watchdog : private NonCopyable<Watchdog> {
5353
public:
54-
static const uint32_t watchdog_timeout = MBED_CONF_TARGET_WATCHDOG_TIMEOUT;
54+
static const uint32_t watchdog_timeout = 800;
5555

5656
/** As Watchdog might not stop ever, there is just one instance - we use single instance.
5757
* This ensures we keep Watchdog alive. To operate watchdog, use start/stop methods.

targets/targets.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@
5151
"init-us-ticker-at-boot": {
5252
"help": "Initialize the microsecond ticker at boot rather than on first use, and leave it initialized. This speeds up wait_us in particular.",
5353
"value": false
54-
},
55-
"watchdog-timeout": {
56-
"help": "Define the timeout in ms to do HW kick",
57-
"value": "800",
5854
}
5955
}
6056
},

0 commit comments

Comments
 (0)