From: Frank Mori Hess Date: Tue, 24 Oct 2006 15:26:51 +0000 (+0000) Subject: m-series has 16 pfi lines instead of 10. X-Git-Tag: r0_7_74~178 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1e649ffdfd4075b5ded595cdb6266bad94c0eccf;p=comedi.git m-series has 16 pfi lines instead of 10. --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index df330ac5..1a506330 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -3220,11 +3220,17 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it) s->insn_read = &ni_eeprom_insn_read; } /* PFI */ - s=dev->subdevices+7; - s->type=COMEDI_SUBD_DIO; - s->subdev_flags=SDF_READABLE|SDF_WRITABLE|SDF_INTERNAL; - s->n_chan=10; - s->maxdata=1; + s=dev->subdevices + 7; + s->type = COMEDI_SUBD_DIO; + s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_INTERNAL; + if(boardtype.reg_type == ni_reg_m_series) + { + s->n_chan = 16; + }else + { + s->n_chan = 10; + } + s->maxdata = 1; s->insn_bits = ni_pfi_insn_bits; s->insn_config = ni_pfi_insn_config; ni_set_bits(dev, IO_Bidirection_Pin_Register, ~0, 0); @@ -4275,7 +4281,6 @@ static int ni_pfi_insn_config(comedi_device *dev,comedi_subdevice *s, if(insn->n < 1)return -EINVAL; chan = CR_CHAN(insn->chanspec); - if(chan>10)return -EINVAL; switch(data[0]){ case COMEDI_OUTPUT: