diff --git a/platform/mbed_watchdog_mgr.cpp b/platform/mbed_watchdog_mgr.cpp index 56cc7c6f7d..f9d51bce04 100644 --- a/platform/mbed_watchdog_mgr.cpp +++ b/platform/mbed_watchdog_mgr.cpp @@ -24,6 +24,7 @@ static bool is_watchdog_started = false; //boolean to control watchdog start and static uint32_t elapsed_ms = (HW_WATCHDOG_TIMEOUT / 2); MBED_STATIC_ASSERT((HW_WATCHDOG_TIMEOUT > 0), "Timeout must be greater than zero"); +#if DEVICE_LPTICKER /** Create singleton instance of LowPowerTicker for watchdog periodic call back of kick. */ static SingletonPtr get_ticker() @@ -31,6 +32,15 @@ static SingletonPtr get_ticker() static SingletonPtr ticker; return ticker; } +#else +/** Create singleton instance of Ticker for watchdog periodic call back of kick. + */ +static SingletonPtr get_ticker() +{ + static SingletonPtr ticker; + return ticker; +} +#endif /** Refreshes the watchdog timer. * diff --git a/platform/mbed_watchdog_mgr.h b/platform/mbed_watchdog_mgr.h index 4a92732cfe..6d06dda0fb 100644 --- a/platform/mbed_watchdog_mgr.h +++ b/platform/mbed_watchdog_mgr.h @@ -25,7 +25,11 @@ #include "platform/Callback.h" #include "platform/mbed_critical.h" #include "platform/SingletonPtr.h" +#if DEVICE_LPTICKER #include "LowPowerTicker.h" +#else +#include "Ticker.h" +#endif #include "Watchdog.h" #ifdef __cplusplus