Commit 27cb9814 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: s626: clarify COMEDI_CB_EOA code

The end-of-acquisition only applies when the cmd->stop_src == TRIG_COUNT.

Refactor the code in s626_handle_eos_interrupt() that detects the end-of-
acquisition to clarify this.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e37b20aa
...@@ -1501,19 +1501,20 @@ static bool s626_handle_eos_interrupt(struct comedi_device *dev) ...@@ -1501,19 +1501,20 @@ static bool s626_handle_eos_interrupt(struct comedi_device *dev)
/* end of scan occurs */ /* end of scan occurs */
async->events |= COMEDI_CB_EOS; async->events |= COMEDI_CB_EOS;
if (cmd->stop_src == TRIG_COUNT) if (cmd->stop_src == TRIG_COUNT) {
devpriv->ai_sample_count--; devpriv->ai_sample_count--;
if (devpriv->ai_sample_count <= 0) { if (devpriv->ai_sample_count <= 0) {
devpriv->ai_cmd_running = 0; devpriv->ai_cmd_running = 0;
/* Stop RPS program */ /* Stop RPS program */
s626_mc_disable(dev, S626_MC1_ERPS1, S626_P_MC1); s626_mc_disable(dev, S626_MC1_ERPS1, S626_P_MC1);
/* send end of acquisition */ /* send end of acquisition */
async->events |= COMEDI_CB_EOA; async->events |= COMEDI_CB_EOA;
/* disable master interrupt */ /* disable master interrupt */
finished = true; finished = true;
}
} }
if (devpriv->ai_cmd_running && cmd->scan_begin_src == TRIG_EXT) if (devpriv->ai_cmd_running && cmd->scan_begin_src == TRIG_EXT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment