Updating for comedi-0.7.39 and RTLinux-2.1
authorDavid Schleef <ds@schleef.org>
Thu, 10 Feb 2000 00:11:16 +0000 (00:11 +0000)
committerDavid Schleef <ds@schleef.org>
Thu, 10 Feb 2000 00:11:16 +0000 (00:11 +0000)
demo/rt/Makefile
demo/rt/it.c

index 2cf877127246c56d5d28bb011cf4eb4df97c9196..64ded7147540075af54928e5c8e751b145f69f26 100644 (file)
@@ -4,9 +4,14 @@
 # I don't have RTLinux installed on the computer
 # that I use to compile, so I need this:
 
-RTINCDIR = -I/b/ds/stuff/rtlinux/r-9J/rtl/include
-
-CFLAGS = -I../../include $(RTINCDIR) -O2 -Wall -D__RT__ -D__KERNEL__ -DMODULE
+LINUXDIR := /d/ds/cvs/rtl/linux22
+RTINCDIR := /usr/include/rtlinux
+
+CFLAGS = -O2 -Wall -D__KERNEL__ -DMODULE
+CFLAGS += -I $(LINUXDIR)/include
+CFLAGS += -I $(RTINCDIR) -O2 -Wall -D__RTL__
+CFLAGS += -D__SMP__
+CFLAGS += -DMODVERSIONS -include $(LINUXDIR)/include/linux/modversions.h
 
 all: it.o ai.o
 
index 642598a5d12b3bda8689934e6df7d00e24e6e6d8..276f6018d0adeaf4c43326024460deed0f2ce199 100644 (file)
@@ -1,9 +1,10 @@
 
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/version.h>
 #include <rtl_sched.h>
+#include <rtl_compat.h>
+#include <rtl_printf.h>
 #include <asm/rt_time.h>
 #include <comedi.h>
 
@@ -39,6 +40,7 @@ int init_module(void)
        trig.n_chan=1;
        trig.chanlist=&channel;
        trig.data=&data;
+       trig.data_len=1;
        trig.n=1;
        trig.trigsrc=0;
        trig.trigvar=0;
@@ -50,11 +52,11 @@ int init_module(void)
        comedi_lock_ioctl(dev,subdev);
 
        /* configure DIO 0 for output */
-       trig.flags=TRIG_CONFIG;
+       trig.flags=TRIG_CONFIG|TRIG_WRITE;
        data=COMEDI_OUTPUT;
        ret=comedi_trig_ioctl(dev,subdev,&trig);
        printk("comedi_trig_ioctl() returned %d\n",ret);
-       trig.flags=0;
+       trig.flags=TRIG_WRITE;
        data=1;
 
        /* a little test */
@@ -63,7 +65,7 @@ int init_module(void)
 
        rt_task_init(&mytask,do_comedi_toggle, 0xffff, 3000, 4);
        
-       rt_task_make_periodic(&mytask,now+3000,50000);
+       rt_task_make_periodic(&mytask,now+3000,1000);
 
        return 0;
 }