From: Frank Mori Hess Date: Thu, 22 Dec 2005 02:21:36 +0000 (+0000) Subject: Fix 2's complement munging for ai insn with 18 bit boards. X-Git-Tag: r0_7_71~91 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fa740ee6b6250f806269c1c04268f5d9a846ab82;p=comedi.git Fix 2's complement munging for ai insn with 18 bit boards. insn work for ai on pci-6289 now. --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 0de83551..80955708 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -1178,7 +1178,7 @@ static int ni_ai_insn_read(comedi_device *dev,comedi_subdevice *s,comedi_insn *i { int i,n; unsigned int mask; - unsigned short signbits; + unsigned signbits; unsigned short d; ni_load_channelgain_list(dev,1,&insn->chanspec); @@ -1212,7 +1212,7 @@ static int ni_ai_insn_read(comedi_device *dev,comedi_subdevice *s,comedi_insn *i rt_printk("ni_mio_common: timeout in 611x ni_ai_insn_read\n"); return -ETIME; } - d += signbits; /* subtle: needs to be short addition */ + d += signbits; data[ n ] = d; } }else{ @@ -1276,7 +1276,7 @@ static void ni_load_channelgain_list(comedi_device *dev,unsigned int n_chan, unsigned int chan,range,aref; unsigned int i; unsigned int hi,lo; - unsigned short offset; + unsigned offset; unsigned int dither; if(n_chan == 1 && boardtype.reg_type != ni_reg_611x){ diff --git a/comedi/drivers/ni_stc.h b/comedi/drivers/ni_stc.h index 952f2ef7..23b260c5 100644 --- a/comedi/drivers/ni_stc.h +++ b/comedi/drivers/ni_stc.h @@ -1057,7 +1057,7 @@ static ni_board ni_boards[]; int gpct_cur_operation[2]; \ unsigned short an_trig_etc_reg; \ \ - unsigned short ai_offset[512]; \ + unsigned ai_offset[512]; \ \ unsigned long serial_interval_ns; \ unsigned char serial_hw_mode; \