mirror of https://github.com/ARMmbed/mbed-os.git
Added the ticker support
-Modified the device dont have support of lp ticker will ticker for watchdog callback registerpull/10645/head
parent
dfe4b533c3
commit
33793e710d
|
@ -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);
|
static uint32_t elapsed_ms = (HW_WATCHDOG_TIMEOUT / 2);
|
||||||
MBED_STATIC_ASSERT((HW_WATCHDOG_TIMEOUT > 0), "Timeout must be greater than zero");
|
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.
|
/** Create singleton instance of LowPowerTicker for watchdog periodic call back of kick.
|
||||||
*/
|
*/
|
||||||
static SingletonPtr<mbed::LowPowerTicker> get_ticker()
|
static SingletonPtr<mbed::LowPowerTicker> get_ticker()
|
||||||
|
@ -31,6 +32,15 @@ static SingletonPtr<mbed::LowPowerTicker> get_ticker()
|
||||||
static SingletonPtr<mbed::LowPowerTicker> ticker;
|
static SingletonPtr<mbed::LowPowerTicker> ticker;
|
||||||
return ticker;
|
return ticker;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
/** Create singleton instance of Ticker for watchdog periodic call back of kick.
|
||||||
|
*/
|
||||||
|
static SingletonPtr<mbed::Ticker> get_ticker()
|
||||||
|
{
|
||||||
|
static SingletonPtr<mbed::Ticker> ticker;
|
||||||
|
return ticker;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Refreshes the watchdog timer.
|
/** Refreshes the watchdog timer.
|
||||||
*
|
*
|
||||||
|
|
|
@ -25,7 +25,11 @@
|
||||||
#include "platform/Callback.h"
|
#include "platform/Callback.h"
|
||||||
#include "platform/mbed_critical.h"
|
#include "platform/mbed_critical.h"
|
||||||
#include "platform/SingletonPtr.h"
|
#include "platform/SingletonPtr.h"
|
||||||
|
#if DEVICE_LPTICKER
|
||||||
#include "LowPowerTicker.h"
|
#include "LowPowerTicker.h"
|
||||||
|
#else
|
||||||
|
#include "Ticker.h"
|
||||||
|
#endif
|
||||||
#include "Watchdog.h"
|
#include "Watchdog.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in New Issue