From 973ac3e64e8c810bbac0148fd6f51d3df19e9585 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Fri, 22 Mar 2013 15:47:43 +0000 Subject: [PATCH] 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 --- comedi/drivers/s626.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comedi/drivers/s626.c b/comedi/drivers/s626.c index 059817c4..d0e1cebc 100644 --- a/comedi/drivers/s626.c +++ b/comedi/drivers/s626.c @@ -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; } -- 2.26.2