summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-11-17 12:08:25 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-11-17 12:08:25 +0000
commitc021964a6bd0319748457772ce8179935f54bbf7 (patch)
treeebc47002688ada2b15b6f3fbbb0a43f1922841b3 /nuttx/sched
parent4f3a80e30cf925912316179463f7f1288bd0aac8 (diff)
downloadpx4-nuttx-c021964a6bd0319748457772ce8179935f54bbf7.tar.gz
px4-nuttx-c021964a6bd0319748457772ce8179935f54bbf7.tar.bz2
px4-nuttx-c021964a6bd0319748457772ce8179935f54bbf7.zip
Fix error in timer_settime()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3117 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/timer_settime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/nuttx/sched/timer_settime.c b/nuttx/sched/timer_settime.c
index 6aceea27c..035852315 100644
--- a/nuttx/sched/timer_settime.c
+++ b/nuttx/sched/timer_settime.c
@@ -1,7 +1,7 @@
/********************************************************************************
* sched/timer_settime.c
*
- * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -308,7 +308,7 @@ int timer_settime(timer_t timerid, int flags, FAR const struct itimerspec *value
if (!timer || !value)
{
- *get_errno_ptr() = EINVAL;
+ errno = EINVAL;
return ERROR;
}
@@ -349,7 +349,7 @@ int timer_settime(timer_t timerid, int flags, FAR const struct itimerspec *value
#ifdef CONFIG_DISABLE_CLOCK
/* Absolute timing depends upon having access to clock functionality */
- *get_errno_ptr() = ENOSYS;
+ errno = ENOSYS;
return ERROR;
#else
/* Calculate a delay corresponding to the absolute time in 'value'.
@@ -371,7 +371,7 @@ int timer_settime(timer_t timerid, int flags, FAR const struct itimerspec *value
}
/* If the time is in the past or now, then set up the next interval
- * instead.
+ * instead (assuming a repititive timer).
*/
if (delay <= 0)
@@ -385,7 +385,7 @@ int timer_settime(timer_t timerid, int flags, FAR const struct itimerspec *value
if (delay > 0)
{
timer->pt_last = delay;
- ret = wd_start(timer->pt_wdog, timer->pt_delay, (wdentry_t)timer_timeout, 1, (uint32_t)((uintptr_t)timer));
+ ret = wd_start(timer->pt_wdog, delay, (wdentry_t)timer_timeout, 1, (uint32_t)((uintptr_t)timer));
}
irqrestore(state);