summaryrefslogtreecommitdiff
path: root/nuttx/sched/wdog/wd_start.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-21 08:44:29 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-21 08:44:29 -0600
commit4d70630480d6a9f478948d85a56069e78f4c071e (patch)
tree715821e8280921414a7751c57be1477f2b4ac769 /nuttx/sched/wdog/wd_start.c
parentc49473edacae7ffd2b31b53a5cec119f0c7a1676 (diff)
downloadnuttx-4d70630480d6a9f478948d85a56069e78f4c071e.tar.gz
nuttx-4d70630480d6a9f478948d85a56069e78f4c071e.tar.bz2
nuttx-4d70630480d6a9f478948d85a56069e78f4c071e.zip
If we run out of pre-allocated watchdog times, the logic will allocate additional timers from the heap. A reserve of pre-allocated watchdog timers is maintained so that there will always be timers available for interrupt handlers.
Diffstat (limited to 'nuttx/sched/wdog/wd_start.c')
-rw-r--r--nuttx/sched/wdog/wd_start.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/nuttx/sched/wdog/wd_start.c b/nuttx/sched/wdog/wd_start.c
index 9cf7edc35..009a5d5ee 100644
--- a/nuttx/sched/wdog/wd_start.c
+++ b/nuttx/sched/wdog/wd_start.c
@@ -143,7 +143,7 @@ static inline void wd_expiration(void)
/* Indicate that the watchdog is no longer active. */
- wdog->active = false;
+ WDOG_CLRACTIVE(wdog);
/* Execute the watchdog function */
@@ -250,7 +250,7 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...)
*/
saved_state = irqsave();
- if (wdog->active)
+ if (WDOG_ISACTIVE(wdog))
{
wd_cancel(wdog);
}
@@ -382,8 +382,8 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...)
/* Put the lag into the watchdog structure and mark it as active. */
- wdog->lag = delay;
- wdog->active = true;
+ wdog->lag = delay;
+ WDOG_SETACTIVE(wdog);
#ifdef CONFIG_SCHED_TICKLESS
/* Resume the interval timer that will generate the next interval event.