From 186f5ebc6a6bf3f5db4a55a86b6b209a7e1c2989 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 13 Jun 2005 01:25:12 +0000 Subject: [PATCH] fix for analog output, based on patch from Simone Mannori --- comedi/drivers/cb_das16_cs.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/comedi/drivers/cb_das16_cs.c b/comedi/drivers/cb_das16_cs.c index c437b836..c654bc4f 100644 --- a/comedi/drivers/cb_das16_cs.c +++ b/comedi/drivers/cb_das16_cs.c @@ -481,32 +481,30 @@ static int das16cs_ao_winsn(comedi_device *dev,comedi_subdevice *s,comedi_insn * devpriv->ao_readback[chan] = data[i]; d = data[i]; - //devpriv->status1 |= 0x0009; outw(devpriv->status1, dev->iobase + 4); comedi_udelay(1); - status1 = devpriv->status1; - //if(chan)status1 &= ~0x0008; - //else status1 &= ~0x0001; - if(chan)status1 |= 0x0008; - else status1 |= 0x0001; + status1 = devpriv->status1 & ~0xf; + if(chan) status1 |= 0x0001; + else status1 |= 0x0008; - printk("0x%04x\n",status1); +/* printk("0x%04x\n",status1);*/ outw(status1, dev->iobase + 4); comedi_udelay(1); for(bit=15;bit>=0;bit--){ - int b = (d>>bit)&1; - - printk("0x%04x\n",status1 | b | 0x0000); + int b = (d >> bit) & 0x1; + b <<= 1; +/* printk("0x%04x\n",status1 | b | 0x0000);*/ outw(status1 | b | 0x0000, dev->iobase + 4); comedi_udelay(1); - printk("0x%04x\n",status1 | b | 0x0004); +/* printk("0x%04x\n",status1 | b | 0x0004);*/ outw(status1 | b | 0x0004, dev->iobase + 4); comedi_udelay(1); } - - outw(devpriv->status1, dev->iobase + 4); +/* make high both DAC0CS and DAC1CS to load + new data and update analog output*/ + outw(status1 | 0x9, dev->iobase + 4); } return i; -- 2.26.2