Fix 2's complement munging for ai insn with 18 bit boards.
authorFrank Mori Hess <fmhess@speakeasy.net>
Thu, 22 Dec 2005 02:21:36 +0000 (02:21 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Thu, 22 Dec 2005 02:21:36 +0000 (02:21 +0000)
insn work for ai on pci-6289 now.

comedi/drivers/ni_mio_common.c
comedi/drivers/ni_stc.h

index 0de835510230cf59589e9b93f3dd337d3659adcd..809557080044aae0f9bbf8725828c1fc27ebe3d0 100644 (file)
@@ -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){
index 952f2ef74476943c5b7a6babc0be70e16b2c24d8..23b260c59274d02996fdddf4258986431a15d1a7 100644 (file)
@@ -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;                           \