VirtualWatchdog: add config option to ctor to clarify the hw timeout

pull/10857/head
Martin Kojtal 2019-06-28 10:58:11 +01:00
parent 9f48f26876
commit 61f859b514
2 changed files with 4 additions and 0 deletions

View File

@ -36,6 +36,7 @@ VirtualWatchdog::VirtualWatchdog(uint32_t timeout, const char *const str): _name
if (watchdog.is_running() == true) {
MBED_MAKE_ERROR(MBED_MODULE_DRIVER_WATCHDOG, MBED_ERROR_INITIALIZATION_FAILED);
}
// we use default hw timeout provided by config
watchdog.start(&VirtualWatchdog::process, Watchdog::watchdog_timeout);
_is_hw_watchdog_running = true;
}

View File

@ -54,6 +54,9 @@ class VirtualWatchdog {
public:
/** Constructor configured with timeout and name for this software watchdog instance.
*
* We start hardware watchdog on the first run. This set-up uses default watchdog timeout set via config value
* MBED_CONF_TARGET_WATCHDOG_TIMEOUT.
*
*/
VirtualWatchdog(uint32_t timeout = 1, const char *const str = NULL);