mirror of https://github.com/ARMmbed/mbed-os.git
VirtualWatchdog: fix missing kick and init check in process
Also syntax error for ticker definitions.pull/11023/head
parent
90033869d9
commit
c4eeb5ecbd
|
@ -25,9 +25,9 @@
|
||||||
namespace mbed {
|
namespace mbed {
|
||||||
|
|
||||||
#if DEVICE_LPTICKER
|
#if DEVICE_LPTICKER
|
||||||
SingletonPtr<LowPowerTicker> _ticker;
|
SingletonPtr<LowPowerTicker> VirtualWatchdog::_ticker;
|
||||||
#else
|
#else
|
||||||
SingletonPtr<Ticker> _ticker;
|
SingletonPtr<Ticker> VirtualWatchdog::_ticker;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VirtualWatchdog *VirtualWatchdog::_first = NULL;
|
VirtualWatchdog *VirtualWatchdog::_first = NULL;
|
||||||
|
@ -121,12 +121,16 @@ void VirtualWatchdog::remove_from_list()
|
||||||
|
|
||||||
void VirtualWatchdog::process()
|
void VirtualWatchdog::process()
|
||||||
{
|
{
|
||||||
|
Watchdog::get_instance().kick();
|
||||||
VirtualWatchdog *cur_ptr = _first;
|
VirtualWatchdog *cur_ptr = _first;
|
||||||
while (cur_ptr != NULL) {
|
while (cur_ptr != NULL) {
|
||||||
if (cur_ptr->_current_count > cur_ptr->_timeout) {
|
if (cur_ptr->_is_initialized) {
|
||||||
system_reset();
|
if (cur_ptr->_current_count > cur_ptr->_timeout) {
|
||||||
} else {
|
system_reset();
|
||||||
cur_ptr->_current_count += US_TO_MS(_ticker_timeout);
|
} else {
|
||||||
|
cur_ptr->_current_count += US_TO_MS(_ticker_timeout);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
cur_ptr = cur_ptr->_next;
|
cur_ptr = cur_ptr->_next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue