- From: ÁõÏþ÷ <liuxiaomei_521_at_163.com>
- Date: Thu, 24 Jun 2004 13:16:38 +0800
Hi:
I am using pci1784 in rtlinux3.2(redhat8.0,comedi-0.7.60.comedilib-0.7.19) kernel space.
following is a part of my code:
//1784.c
#define subdev 6
#define N_SAMPLE 2
unsigne int mirror 1 // /dev/comedi1
int channel=1;
int range=0;
int init_module(void)
{
.............
insn.subdev=6;
insn.insn=INSN_READ;
insn.n=2;
insn.chanspec=CR_PACK(channel,range,0);
insn.data=data;
int ret;
ret=comedi_lock(mirror,subdev);
ret=comedi_open(mirror);
if(ret<0)
{
rtl_printf("wrong with open \n");
return 1;
}
ret=comedi_do_insn(mirror,&insn);
if(ret<0)
{
rtl_printf("wrong wtih read \n");
return 1;
}
..............
}
comepile 1784.c to 1784.o
run following command:
modprobe comedi
modprobe kcomedilib
modprobe pci1784
/usr/sbin/comedi_config /dev/comedi1 pci1784
/usr/rtlinux/bin/rtlinux start
insmod 1784.o
Wrong message is:
.............
adv_pci1784:EDBG :BGN pci1784_insn_read_cnt(...)
data[0]=0,data[1]=173
adv_pci1784:EDBG :END pci1784_insn_read_cnt(...)
BUG: result of insn!=insn.n
what's meaning of the last message? how to resolve?
maybe my code is wrong or cann't use 1784 in kernel space?
Thanks for your help!
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡liuxiaomei_521_at_163.com
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2004-06-24
Received on 2004-06-24Z04:16:38