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)
commit973ac3e64e8c810bbac0148fd6f51d3df19e9585
tree010a9d7f47229193fe545b49c025f5fdd0ff428c
parentb593378c9f5cc1a24a81b3f4cac6872f384a6798
s626: fix continuous acquisition

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