Hi,

 

I've just been updating my project to use the latest EtherCAT 1.5.2
master (2526), using RTDM with RTAI.

 

The ethercat_rtdm library calls fprintf to log various errors that may
occur.  This knocks the hard realtime thread back to soft realtime due
to making a standard syscall.  I have created a patch that will use
rt_printk instead if RTDM is active (attached).

 

 

It does the following, in ioctl.h: 

 

#ifdef EC_RTDM

#define   KERN_ERR  "<3>"

#define EC_PRINT_ERR(fmt, args...) \

    printk(KERN_ERR "EtherCAT ERROR: " fmt, ##args) 

#else

#define EC_PRINT_ERR(fmt, args...) \

    fprintf(stderr, fmt, ##args) 

#endif

 

 

and then changes the fprintf's, eg: from:

        fprintf(stderr, "Failed to get reference clock time: %s\n",

                strerror(EC_IOCTL_ERRNO(ret)));

 

to:

        EC_PRINT_ERR("Failed to get reference clock time: %s\n",

                strerror(EC_IOCTL_ERRNO(ret)));

 

 

I see there is a TODO item to replace the fprintf calls with return
codes, but you may want to do this in the meantime (or both).

 

 

Regards,

Graeme.

Attachment: etherlabmaster-1.5.2-2526-aa_lib_fprintf.patch
Description: etherlabmaster-1.5.2-2526-aa_lib_fprintf.patch

_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users

Reply via email to