* [Xenomai-help] timer_settime issue
@ 2009-05-18 13:12 Marcel Soulot
2009-05-18 13:51 ` Gilles Chanteperdrix
0 siblings, 1 reply; 2+ messages in thread
From: Marcel Soulot @ 2009-05-18 13:12 UTC (permalink / raw)
To: Xenomai help
[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]
Hi,
I try to set a 10ms periodic timer but I stay stuck in the call of
timer_settime().
I don't understand why it doesn't leave this function ?
thanks for your help,
Marcel.
here is the source code of my function :
*{*
* struct sigaction sa;
struct itimerspec timer;
int ret;
struct sigevent timer_event;
if (! mbTimerRunning)
{
mbTimerRunning = true;*
* *
* memset (&sa, 0, sizeof (sa));
sa.sa_handler = &CTimerManagment::timer_handler;
ret = sigaction (SIGALRM, &sa, NULL);
if (ret < 0)
{
printf("Error sigaction code %d.\n", ret);
}
// Configure the timer to expire after 10 msec...
timer.it_value.tv_sec = 0;
timer.it_value.tv_nsec = 10000;*
**
* // ... and every 10 msec after that.
timer.it_interval.tv_sec = 0;
timer.it_interval.tv_nsec = 10000;*
**
* timer_event.sigev_notify = SIGEV_SIGNAL;
timer_event.sigev_signo = SIGALRM;
timer_event.sigev_value.sival_ptr = (void*)&mytimer;*
**
* ret = timer_create(CLOCK_REALTIME, &timer_event, &mytimer);
if (0 > ret)
{
printf("Error timer_create %d\n", ret);
}
*
* ret = timer_settime(mytimer, 0, &timer, NULL);
if (0 > ret)
{
printf("Error timer_settime %d\n", ret);
}
}
}*
**
**
[-- Attachment #2: Type: text/html, Size: 2427 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Xenomai-help] timer_settime issue
2009-05-18 13:12 [Xenomai-help] timer_settime issue Marcel Soulot
@ 2009-05-18 13:51 ` Gilles Chanteperdrix
0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2009-05-18 13:51 UTC (permalink / raw)
To: Marcel Soulot; +Cc: Xenomai help
Marcel Soulot wrote:
> // Configure the timer to expire after 10 msec...
> timer.it_value.tv_sec = 0;
> timer.it_value.tv_nsec = 10000;*
> **
> * // ... and every 10 msec after that.
> timer.it_interval.tv_sec = 0;
> timer.it_interval.tv_nsec = 10000;*
For documentation on the struct timespec structure, see:
http://www.opengroup.org/onlinepubs/009695399/basedefs/time.h.html
--
Gilles.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-18 13:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-18 13:12 [Xenomai-help] timer_settime issue Marcel Soulot
2009-05-18 13:51 ` Gilles Chanteperdrix
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.