From: Frank Mori Hess Date: Sat, 19 Jun 2004 13:04:40 +0000 (+0000) Subject: fix selection of output channel for ao write insn (for boards with fifo) X-Git-Tag: r0_7_69~31 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5ef07e49da293d70a0dd4a233751eb2c25cd99e8;p=comedi.git fix selection of output channel for ao write insn (for boards with fifo) --- diff --git a/comedi/drivers/cb_pcidas.c b/comedi/drivers/cb_pcidas.c index 9f5821b7..a6be21ea 100644 --- a/comedi/drivers/cb_pcidas.c +++ b/comedi/drivers/cb_pcidas.c @@ -872,8 +872,8 @@ static int cb_pcidas_ao_nofifo_winsn(comedi_device *dev, comedi_subdevice *s, // set channel and range channel = CR_CHAN(insn->chanspec); comedi_spin_lock_irqsave( &dev->spinlock, flags ); - devpriv->ao_control_bits &= ~DAC_MODE_UPDATE_BOTH & ~DAC_RANGE_MASK( channel ); - devpriv->ao_control_bits |= DACEN | DAC_RANGE( channel, CR_RANGE( insn->chanspec ) ); + devpriv->ao_control_bits &= ~DAC_MODE_UPDATE_BOTH & ~DAC_RANGE_MASK(channel); + devpriv->ao_control_bits |= DACEN | DAC_RANGE(channel, CR_RANGE(insn->chanspec)); outw( devpriv->ao_control_bits, devpriv->control_status + DAC_CSR ); comedi_spin_unlock_irqrestore( &dev->spinlock, flags ); @@ -897,11 +897,12 @@ static int cb_pcidas_ao_fifo_winsn(comedi_device *dev, comedi_subdevice *s, // set channel and range channel = CR_CHAN(insn->chanspec); - comedi_spin_lock_irqsave( &dev->spinlock, flags ); - devpriv->ao_control_bits &= ~DAC_MODE_UPDATE_BOTH & ~DAC_RANGE_MASK( channel ) & - ~DAC_START & ~DAC_PACER_MASK; - devpriv->ao_control_bits |= DACEN | DAC_RANGE( channel, CR_RANGE( insn->chanspec ) ); - outw( devpriv->ao_control_bits, devpriv->control_status + DAC_CSR ); + comedi_spin_lock_irqsave(&dev->spinlock, flags); + devpriv->ao_control_bits &= ~DAC_CHAN_EN(0) & ~DAC_CHAN_EN(1) & ~DAC_RANGE_MASK(channel) & + ~DAC_PACER_MASK; + devpriv->ao_control_bits |= DACEN | DAC_RANGE(channel, CR_RANGE(insn->chanspec)) | + DAC_CHAN_EN(channel) | DAC_START; + outw(devpriv->ao_control_bits, devpriv->control_status + DAC_CSR); comedi_spin_unlock_irqrestore( &dev->spinlock, flags ); // remember value for readback