Vasili Goutas wrote:
> 
> Thanks for the answer,
> 
> I now can't get the process to runn periodic.
> I try folloing calls inside the process wich is started whith
> rt_task_resume after initialisation.
>   start_time =  msec2start * 1000 * 1000;       //start in X nanosec
>   rt_sleep( nano2count( start_time ) );
> 
>   rt_set_periodic_mode();
>   rtl_printf ( KERN_DEBUG
>                            "RTAI dmm16: going to make reading thread periodic.\n" );
>   if ( rt_task_make_periodic_relative_ns( rt_whoami(),
>                                           1000000,
>                                           period ) != 0 ){
>     rtl_printf( KERN_ERR "RTAI dmm16: error making reading thread
> periodic\n");
>     return;
>   }
> 
>   do {
>         rt_task_wait_period( );
>         ...
> 
>   }while(1)
> 

When you do rt_set_periodic you stop any running timer. The sequence is:
rt_set_periodic_mode();
start_rt_timer(....);
Beside the fact that it does not make sense to set the timer mode after
having starting the timer, you must not do that in tasks but at the
initting of your module. Note also that the periodic mode is the the
default one and need not to be set, if you never used oneshot before.

Moreover what's the type msec2start? Hope long long, or you get into
trouble if it is sligtly more that 4000.

Ciao, Paolo.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to