unsigned int use_ext_trg:1;
unsigned int ai_dma:1;
unsigned int ai_eos:1;
- unsigned int ai_neverending:1;
};
static void setup_range_channel(struct comedi_device *dev,
devpriv->ai_dma = 0;
devpriv->ai_data_len = s->async->prealloc_bufsz;
- if (cmd->stop_src == TRIG_COUNT)
- devpriv->ai_neverending = 0;
- else
- devpriv->ai_neverending = 1;
-
devpriv->ai_act_scan = 0;
devpriv->ai_poll_ptr = 0;
s->async->cur_chan = 0;
devpriv->dmabytestomove[1] =
devpriv->ai_data_len;
}
- if (devpriv->ai_neverending) {
+ if (cmd->stop_src == TRIG_NONE) {
devpriv->dma_runs_to_end = 1;
} else {
/* how many samples we must transfer? */
s->async->cur_chan = next_chan;
if (next_chan == 0) { /* one scan done */
devpriv->ai_act_scan++;
- if (!(devpriv->ai_neverending))
- /* all data sampled */
- if (devpriv->ai_act_scan >= cmd->stop_arg) {
- s->cancel(dev, s);
- s->async->events |= COMEDI_CB_EOA;
- }
+ if (cmd->stop_src == TRIG_COUNT &&
+ devpriv->ai_act_scan >= cmd->stop_arg) {
+ /* all data sampled */
+ s->cancel(dev, s);
+ s->async->events |= COMEDI_CB_EOA;
+ }
}
comedi_event(dev, s);
if (s->async->cur_chan >= cmd->chanlist_len) {
s->async->cur_chan = 0;
devpriv->ai_act_scan++;
- if (!devpriv->ai_neverending)
- /* all data sampled */
- if (devpriv->ai_act_scan >= cmd->stop_arg) {
- s->cancel(dev, s);
- s->async->events |= COMEDI_CB_EOA;
- break;
- }
+ if (cmd->stop_src == TRIG_COUNT &&
+ devpriv->ai_act_scan >= cmd->stop_arg) {
+ /* all data sampled */
+ s->cancel(dev, s);
+ s->async->events |= COMEDI_CB_EOA;
+ break;
+ }
}
}