s626: fix continuous acquisition
authorIan Abbott <abbotti@mev.co.uk>
Fri, 22 Mar 2013 15:47:43 +0000 (15:47 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Fri, 22 Mar 2013 15:47:43 +0000 (15:47 +0000)
For the s626 driver, there is a bug in the handling of asynchronous
commands on the AI subdevice when the stop source is `TRIG_NONE`.  The
command should run continuously until cancelled, but the interrupt
handler stops the command running after the first scan.

Avoid the problem by setting `devpriv->ai_sample_count = 1` for the
`TRIG_NONE` stop source case in `s626_ai_cmd()`.  This works because the
interrupt handler does not decrement `devpriv->ai_sample_count` if
`devpriv->ai_continous` is true, so the test for
`devpriv->ai_sample_count` being decremented to 0 (or less) will be
false and so it will not stop the acquisition in this case.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
comedi/drivers/s626.c

index 059817c498c19fd1552ac119098c82e1bdd1a8b7..d0e1cebc1330abb1e40ed7962ca0599de4ee25b6 100644 (file)
@@ -1768,7 +1768,7 @@ static int s626_ai_cmd(comedi_device * dev, comedi_subdevice * s)
        case TRIG_NONE:
                // continous aquisition
                devpriv->ai_continous = 1;
-               devpriv->ai_sample_count = 0;
+               devpriv->ai_sample_count = 1;
                break;
        }