bug fixes re failure on comedi_test
authorDavid Schleef <ds@schleef.org>
Wed, 11 Oct 2000 00:50:13 +0000 (00:50 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 11 Oct 2000 00:50:13 +0000 (00:50 +0000)
comedi/drivers/ni_mio_common.c
comedi/drivers/ni_pcimio.c
comedi/drivers/ni_stc.h

index e15f4fc75c9ab6cdacb29a113485d41ad83b9120..a7d0ee83a273fab856aa1c57aa5bd07bdb0c79d8 100644 (file)
@@ -151,7 +151,10 @@ static comedi_lrange *ni_range_lkup[]={
 
 static int ni_dio(comedi_device *dev,comedi_subdevice *s,comedi_trig *it);
 static int ni_eeprom(comedi_device *dev,comedi_subdevice *s,comedi_trig *it);
-static int ni_calib(comedi_device *dev,comedi_subdevice *s,comedi_trig *it);
+static int ni_calib_insn_read(comedi_device *dev,comedi_subdevice *s,
+       comedi_insn *insn,lsampl_t *data);
+static int ni_calib_insn_write(comedi_device *dev,comedi_subdevice *s,
+       comedi_insn *insn,lsampl_t *data);
 
 static void caldac_setup(comedi_device *dev,comedi_subdevice *s);
 static int ni_read_eeprom(comedi_device *dev,int addr);
@@ -1650,7 +1653,7 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it)
        s->maxdata=1;
        s->range_table=&range_digital;
        s->io_bits=0;           /* all bits input */
-       s->insn_read=ni_dio_insn_bits;
+       s->insn_bits=ni_dio_insn_bits;
        s->trig[0]=ni_dio;
 
        /* dio setup */
@@ -1668,17 +1671,20 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it)
        
        /* general purpose counter/timer device */
        s=dev->subdevices+4;
-       gpct_setup(dev,s);
        s->type=COMEDI_SUBD_COUNTER;
+       s->subdev_flags=SDF_READABLE|SDF_WRITEABLE;
        s->trig[0]=ni_gpct;
-       /* XXX */
+       s->n_chan=1; /* XXX */
+       s->maxdata=1;
+       gpct_setup(dev,s);
        
        /* calibration subdevice -- ai and ao */
        s=dev->subdevices+5;
        s->type=COMEDI_SUBD_CALIB;
        s->subdev_flags=SDF_WRITEABLE|SDF_INTERNAL;
        caldac_setup(dev,s);
-       s->trig[0]=ni_calib;
+       s->insn_read=ni_calib_insn_read;
+       s->insn_write=ni_calib_insn_write;
        
        /* EEPROM */
        s=dev->subdevices+6;
@@ -1778,9 +1784,19 @@ static void ni_write_caldac(comedi_device *dev,int addr,int val);
 /*
        calibration subdevice
 */
-static int ni_calib(comedi_device *dev,comedi_subdevice *s,comedi_trig *it)
+static int ni_calib_insn_write(comedi_device *dev,comedi_subdevice *s,
+       comedi_insn *insn,lsampl_t *data)
+{
+       ni_write_caldac(dev,CR_CHAN(insn->chanspec),data[0]);
+       devpriv->caldacs[CR_CHAN(insn->chanspec)] = data[0];
+
+       return 1;
+}
+
+static int ni_calib_insn_read(comedi_device *dev,comedi_subdevice *s,
+       comedi_insn *insn,lsampl_t *data)
 {
-       ni_write_caldac(dev,CR_CHAN(it->chanlist[0]),it->data[0]);
+       data[0] = devpriv->caldacs[CR_CHAN(insn->chanspec)];
 
        return 1;
 }
index 67847d7f85bbbccb21eac199e59b8cccc1edc1c9..f97fb537fc5d2167a55260f1ca95534e0f0ea94e 100644 (file)
@@ -284,7 +284,7 @@ static ni_board ni_boards[]={
                caldac:         type3,
                has_8255:       0,
        },
-       {       device_id:      0x0000,         /* unknown */
+       {       device_id:      0x18b0,
                name:           "pci-6052e",
                n_adchan:       16,
                adbits:         16,
index 64a78224084a29438e906881591b66264f79882e..ea21e6dd802b361062923c6d4d6dc4e0041c4126 100644 (file)
@@ -554,6 +554,9 @@ static ni_board ni_boards[];
        int changain_state;                                     \
        unsigned int changain_spec;                             \
                                                                \
+       unsigned short ao[2];                                   \
+       unsigned short caldacs[12];                             \
+                                                               \
        unsigned short ao_mode1;                                \
        unsigned short ao_mode2;                                \
        unsigned short ao_mode3;                                \