Vasili Goutas wrote:
> 
> Hi
> I'm using rtai-1.4 with linux-2.2.16.
> I have a problem using the function nano2count.
> 
> rt_printk ( KERN_DEBUG
>            "RTAI dmm16: going to make reading thread periodic. period = %lu,
> nano2count(period) = %lu\n", period, nano2count(period) );
> 
> gives me the following output:
> 
> <7>RTAI dmm16: going to make reading thread periodic. period =
> 500000000, nano2count(period) = 0

Above you try to write an %llu with just %lu. What you get is
unpredictable.
Note that you cannot use %llu within the kernel. You should be enough
with: 
rt_printk ( KERN_DEBUG "RTAI dmm16: going to make reading thread
periodic. period = %lu, nano2count(period) = %lu\n", (usigned
long)period, (unsigned long) nano2count(period) );
 
> After the call of
> rt_task_make_periodic_relative_ns( &thread[DMM16_THREAD_READING],
>                                    nano2count( start_time ),
>                                    nano2count( period ) ) != 0 )
> 
> the system freezes because of the task code wich will than runn
> permanent.

The above is used incorrectly, see the new PDF manual at:

http://www.aero.polimi.it/projects/rtai/. 

Assuming delay_from_now and period are in nanoseconds it goes as:

rt_task_make_periodic_relative_ns(&thread[DMM16_THREAD_READING],
delay_from_now, period);

Even if you have no manual, rgrep the wealth of available examples and
you'll immediately get how it is used.

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