comedi and rtai 3.1

Peter Dettori dettori at astro.su.se
Fri Oct 1 14:25:22 CEST 2004


Hi,

I am trying to build rtai-3.1-test5 with comedi support.  I have comedi 
comedi-0.7.68 and comedilib-0.7.21 installed.

Here are the steps I had to follow to get it working:

1. cerate links in /usr/local/comedi to get the config (make menuconfig) 
to work.

2. Then there were a few compile errors in the rtai-addons/comedi 
directory which I got around by commenting some functions out of the 
function entry table declared kcomedi-module.c.  See diffs below, which 
also include modification for comedi.h inclusion in the header.

I am only interested in outputting analog voltages, so I have not 
bothered to look into the compile errors at all.

3. then got the tests.c program from the old tree.  It pretty much 
worked as is except perhaps for the file inclusions.  I have however, 
only called the data_write part of tests.

I then noticed in a september post 
(https://mail.rtai.org/pipermail/rtai/2004-September/008734.html)
that it should work with comedi cvs.  Is that right?  As far as I can 
see though comedilib is still installed in the same place and so some 
modifications have to be made in rtai-addons.  Or have I missed something?

One last thing, I have made tests.c such that it could be put into the 
showroom cvs tree.  Does it belong there, and if so should I just send 
it to this list or somewhere else?  I've also been wondering whether it 
make sense to have the comedi examples parallel to the comedi demo 
programs, info, outp, etc.  I'll do the couple which I can test if it 
seems like a good idea.

,
Pete

diff -u kcomedi-module.c kcomedi-module.c.orig
--- kcomedi-module.c    2004-10-01 11:52:43.000000000 +0200
+++ kcomedi-module.c.orig       2004-10-01 13:48:48.000000000 +0200
@@ -200,21 +200,17 @@
         ,[_KCOMEDI_GET_SUBDEVICE_FLAGS] = { 0, comedi_get_subdevice_flags }
         ,[_KCOMEDI_GET_LEN_CHANLIST]    = { 0, comedi_len_chanlist }
  */
-#if 0
-     ,[_KCOMEDI_GET_KRANGE]          = { 0, comedi_get_krange }
-#endif
+       ,[_KCOMEDI_GET_KRANGE]          = { 0, comedi_get_krange }
  /*
         ,[_KCOMEDI_GET_BUF_HEAD_POS]    = { 0, comedi_get_buf_head_pos }
         ,[_KCOMEDI_SET_USER_INT_COUNT]  = { 0, comedi_set_user_int_count }
         ,[_KCOMEDI_MAP]                 = { 0, comedi_map }
         ,[_KCOMEDI_UNMAP]               = { 0, comedi_unmap }
  */
-#if 0
         ,[_KCOMEDI_WAIT]                = { UW1(2, 3), rt_comedi_wait }
         ,[_KCOMEDI_WAIT_IF]             = { UW1(2, 3), rt_comedi_wait_if }
         ,[_KCOMEDI_WAIT_UNTIL]          = { UW1(4, 5), 
rt_comedi_wait_until }
         ,[_KCOMEDI_WAIT_TIMED]          = { UW1(4, 5), 
rt_comedi_wait_timed }
-#endif
         ,[_KCOMEDI_ALLOC_CMD]           = { 0, rt_comedi_alloc_cmd }
         ,[_KCOMEDI_FREE_CMD]            = { 0, rt_comedi_free_cmd }
  };
$ diff -u rtai_comedi.h rtai_comedi.h.orig
--- rtai_comedi.h       2004-10-01 11:03:12.000000000 +0200
+++ rtai_comedi.h.orig  2004-10-01 13:47:43.000000000 +0200
@@ -123,7 +123,7 @@
  #include <string.h>
  #include <asm/rtai_lxrt.h>
  #include <rtai_shm.h>
-#include <comedi.h>
+#include <linux/comedi.h>

  #define COMEDI_LXRT_SIZARG sizeof(arg)





More information about the Rtai mailing list