adl_pci9111: bug fix for AI commands when scan_begin_src is TRIG_FOLLOW.
authorIan Abbott <abbotti@mev.co.uk>
Fri, 18 Jun 2010 10:00:26 +0000 (10:00 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Fri, 18 Jun 2010 10:00:26 +0000 (10:00 +0000)
The dev_private->scan_delay should have been left set to 0 in this case,
but it ended up being set to (unsigned int)-1.

comedi/drivers/adl_pci9111.c

index 2bc370c406311f56fc3d597a87086630ad60296b..85dc4dc6a84dc607cd9c526d5601587c73eb7523 100644 (file)
@@ -833,9 +833,12 @@ static int pci9111_ai_do_cmd(comedi_device * dev, comedi_subdevice * subdevice)
                plx9050_interrupt_control(dev_private->lcr_io_base, true, true,
                        false, true, true);
 
-               dev_private->scan_delay =
-                       (async_cmd->scan_begin_arg / (async_cmd->convert_arg *
-                               async_cmd->chanlist_len)) - 1;
+               if (async_cmd->scan_begin_src == TRIG_TIMER) {
+                       dev_private->scan_delay =
+                               (async_cmd->scan_begin_arg /
+                                (async_cmd->convert_arg *
+                                 async_cmd->chanlist_len)) - 1;
+               }
 
                break;