clear/set adc enable bit during ai cmd setup, so that start triggers
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 12 Sep 2003 00:34:07 +0000 (00:34 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 12 Sep 2003 00:34:07 +0000 (00:34 +0000)
work

comedi/drivers/cb_pcidas64.c

index c78f23d1599d8fd750d62fc4eebcfa6496cfb849..8eec86a421ff5cf7d2df4d692983390009e5d879 100644 (file)
@@ -2116,14 +2116,14 @@ static void disable_ai_pacing( comedi_device *dev )
 
        disable_ai_interrupts( dev );
 
-       /* disable pacing, triggering, etc */
-       writew( ADC_ENABLE_BIT | ADC_DMA_DISABLE_BIT | ADC_SOFT_GATE_BITS | ADC_GATE_LEVEL_BIT,
-               priv(dev)->main_iobase + ADC_CONTROL0_REG );
-
        comedi_spin_lock_irqsave( &dev->spinlock, flags );
        priv(dev)->adc_control1_bits &= ~SW_GATE_BIT;
        writew( priv(dev)->adc_control1_bits, priv(dev)->main_iobase + ADC_CONTROL1_REG );
        comedi_spin_unlock_irqrestore( &dev->spinlock, flags );
+
+       /* disable pacing, triggering, etc */
+       writew( ADC_DMA_DISABLE_BIT | ADC_SOFT_GATE_BITS | ADC_GATE_LEVEL_BIT,
+               priv(dev)->main_iobase + ADC_CONTROL0_REG );
 }
 
 static void disable_ai_interrupts( comedi_device *dev )
@@ -2376,6 +2376,11 @@ static int ai_cmd(comedi_device *dev,comedi_subdevice *s)
 
        disable_ai_pacing( dev );
 
+       /* adc must be enabled or loading of channel queue becomes
+        * unreliable */
+       writew( ADC_ENABLE_BIT | ADC_DMA_DISABLE_BIT | ADC_SOFT_GATE_BITS |
+               ADC_GATE_LEVEL_BIT, priv(dev)->main_iobase + ADC_CONTROL0_REG );
+
        // make sure internal calibration source is turned off
        writew(0, priv(dev)->main_iobase + CALIBRATION_REG);