Watchdog: remove config value for timeout, set it dynamically

Use start method to set timeout
pull/10857/head
Martin Kojtal 2019-07-01 15:24:35 +01:00
parent 6313e530b3
commit fd445a57cb
4 changed files with 4 additions and 8 deletions

View File

@ -63,6 +63,6 @@ TEST_F(TestWatchdog, test_watchdog_get_max_timeout)
TEST_F(TestWatchdog, test_watchdog_get_timeout)
{
EXPECT_EQ(500, Watchdog::get_instance().get_timeout());
EXPECT_EQ(Watchdog::watchdog_timeout, Watchdog::get_instance().get_timeout());
}

View File

@ -24,5 +24,5 @@ set(unittest-test-sources
)
# defines
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1 -DMBED_CONF_TARGET_WATCHDOG_TIMEOUT=500")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1 -DMBED_CONF_TARGET_WATCHDOG_TIMEOUT=500")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1")

View File

@ -51,7 +51,7 @@ namespace mbed {
*/
class Watchdog : private NonCopyable<Watchdog> {
public:
static const uint32_t watchdog_timeout = MBED_CONF_TARGET_WATCHDOG_TIMEOUT;
static const uint32_t watchdog_timeout = 800;
/** As Watchdog might not stop ever, there is just one instance - we use single instance.
* This ensures we keep Watchdog alive. To operate watchdog, use start/stop methods.

View File

@ -47,10 +47,6 @@
"tickless-from-us-ticker": {
"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",
"value": false
},
"watchdog-timeout": {
"help": "Define the timeout in ms to do HW kick",
"value": "800"
}
}
},