48 WatchDog (
const uint32_t (&stack)[N],
const unsigned int timeout,
49 const unsigned int monitorFrequency = MICROSECOND << 7)
52 m_sleepTime(monitorFrequency) { }
64 register unsigned int delay = CNT + this->m_sleepTime;
67 delay += this->m_sleepTime;
68 const unsigned int timeSinceTimerReset = CNT - this->m_timer;
69 if (timeSinceTimerReset > this->m_timeout)
75 const unsigned int m_timeout;
76 const unsigned int m_sleepTime;
77 volatile unsigned int m_timer;
WatchDog(const uint32_t(&stack)[N], const unsigned int timeout, const unsigned int monitorFrequency=MICROSECOND<< 7)
Constructor.
void run()
Invoked in the new cog, this method should be the root of the business logic.
Generic definitions and functions for the Parallax Propeller.
void reset()
Reset the timer.
static void reboot()
Perform hard reboot.
Helper class for creating easy parallel applications.
Simple WatchDog object for resetting the chip if it stops responding.