timer_gettime was not returning the right value for it_interval

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@116 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2007-03-21 20:03:32 +00:00
parent b7b7b17b6b
commit fb91e7397a
3 changed files with 4 additions and 1 deletions

View File

@ -114,7 +114,7 @@ int timer_gettime(timer_t timerid, FAR struct itimerspec *value)
/* Convert that to a struct timespec and return it */
(void)clock_ticks2time(ticks, &value->it_value);
(void)clock_ticks2time(timer->pt_delay, &value->it_interval);
(void)clock_ticks2time(timer->pt_last, &value->it_interval);
return OK;
}

View File

@ -65,6 +65,7 @@ struct posix_timer_s
ubyte pt_signo; /* Notification signal */
pid_t pt_owner; /* Creator of timer */
int pt_delay; /* If non-zero, used to reset repetitive timers */
int pt_last; /* Last value used to set watchdog */
WDOG_ID pt_wdog; /* The watchdog that provides the timing */
union sigval pt_value; /* Data passed with notification */
};

View File

@ -139,6 +139,7 @@ static void inline timer_restart(FAR struct posix_timer_s *timer, uint32 itimer)
if (timer->pt_delay)
{
timer->pt_last = timer->pt_delay;
(void)wd_start(timer->pt_wdog, timer->pt_delay, timer_timeout, 1, itimer);
}
}
@ -353,6 +354,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, timer_timeout, 1, (uint32)timer);
}