matrix_df hotmail wrote:
> Hello
> 
>> Your build must have become inconsistent in some way. Are you sure that
>> the latest RTnet modules are installed on the master, not accidentally
>> some older ones?
> 
> I am sure, but I will double check.
> 
> When I use your test program it works:
> 
> -----------------------------------------------------
> #include <stdio.h>
> #include <sys/mman.h>
> #include <native/task.h>
> #include <rtnet.h>
> #include <rtmac.h>
> 
> main()
> {
>    int i, fd, err;
>    RT_TASK task;
> 
>    mlockall(MCL_CURRENT | MCL_FUTURE);
> 
>    fd = rt_dev_open("TDMA0", O_RDWR);
>    printf("open = %d\n", fd);
> 
>    rt_task_shadow(&task, "waitonsync", 1, 0);
> 
>    for (i=0; i < 100; i++) {
>        err = rt_dev_ioctl(fd, RTMAC_RTIOC_WAITONCYCLE,
>                           TDMA_WAIT_ON_SYNC);
>        if (err)
>            printf("TDMA_WAIT_ON_SYNC = %d\n", err);
>    }
>    printf("done\n");
>    rt_dev_close(fd);
> }
> ---------------------------------------------------------------
> 
> BUT when I remove the lines with
>   mlockall(MCL_CURRENT | MCL_FUTURE);
> and
>   rt_task_shadow(&task, "waitonsync", 1, 0);
> it FAILS with error=-13:

Argh: "When I pull the plug, my TV doesn't work. Is it broken?" ;)

Both lines above are essential. The first one makes sure your
application's memory will remain physically present and not swapped away
e.g. The second one turns the main thread of this program into a Xenomai
thread, and this is required to block on an event out of the real-time
domain like the arrival of a TDMA SYNC frame.

But if you have a demo code that doesn't work while the above example
does, please post it.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
RTnet-users mailing list
RTnet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rtnet-users

Reply via email to