};
struct pcl711_private {
- int ntrig;
+ unsigned int ntrig;
unsigned int ao_readback[2];
unsigned int divisor1;
unsigned int divisor2;
outb(PCL711_INT_STAT_CLR, dev->iobase + PCL711_INT_STAT_REG);
- /* FIXME! Nothing else sets ntrig! */
- if (!(--devpriv->ntrig)) {
+ if (s->async->cmd.stop_src == TRIG_COUNT && !(--devpriv->ntrig)) {
pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG);
-
s->async->events |= COMEDI_CB_EOA;
}
comedi_event(dev, s);
pcl711_set_changain(dev, s, cmd->chanlist[0]);
+ if (cmd->stop_src == TRIG_COUNT) {
+ if (cmd->stop_arg == 0) {
+ /* an empty acquisition */
+ s->async->events |= COMEDI_CB_EOA;
+ comedi_event(dev, s);
+ return 0;
+ }
+ devpriv->ntrig = cmd->stop_arg;
+ }
+
if (cmd->scan_begin_src == TRIG_TIMER) {
i8254_load(dev->iobase + PCL711_TIMER_BASE, 0,
1, devpriv->divisor1, I8254_MODE2 | I8254_BINARY);