Skip to content

Commit fd445a5

Browse files
committed
Watchdog: remove config value for timeout, set it dynamically
Use start method to set timeout
1 parent 6313e53 commit fd445a5

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
@@ -47,10 +47,6 @@
4747
"tickless-from-us-ticker": {
4848
"help": "Run tickless from the microsecond ticker rather than the low power ticker. Running tickless off of the microsecond ticker improves interrupt latency on targets which use lpticker_delay_ticks",
4949
"value": false
50-
},
51-
"watchdog-timeout": {
52-
"help": "Define the timeout in ms to do HW kick",
53-
"value": "800"
5450
}
5551
}
5652
},

0 commit comments

Comments
 (0)