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);
        }
    }
}*
**
**
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to