VirtualWatchdog: fix error code and timeout

pull/10857/head
Martin Kojtal 2019-06-28 09:09:40 +01:00
parent 02936376ae
commit 1c0f1880eb
2 changed files with 4 additions and 4 deletions

View File

@ -34,9 +34,9 @@ VirtualWatchdog::VirtualWatchdog(uint32_t timeout, const char *const str): _name
Watchdog &watchdog = Watchdog::get_instance();
if (!_is_hw_watchdog_running) {
if (watchdog.is_running() == true) {
MBED_MAKE_ERROR(MBED_MODULE_DRIVER_WATCHDOG, INITIALIZATION_FAILED);
MBED_MAKE_ERROR(MBED_MODULE_DRIVER_WATCHDOG, MBED_ERROR_INITIALIZATION_FAILED);
}
watchdog.start(&VirtualWatchdog::process, Watchdog::elapsed_ms);
watchdog.start(&VirtualWatchdog::process, Watchdog::watchdog_timeout);
_is_hw_watchdog_running = true;
}
}

View File

@ -21,10 +21,10 @@
#ifdef DEVICE_WATCHDOG
#include <cstdio>
#include "mbed_error.h"
#include "platform/mbed_error.h"
#include "platform/mbed_critical.h"
#include "platform/mbed_power_mgmt.h"
#include "mbed_assert.h"
#include "platform/mbed_assert.h"
namespace mbed {