fix to cmdtest
authorFrank Mori Hess <fmhess@speakeasy.net>
Thu, 22 Nov 2001 16:15:34 +0000 (16:15 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Thu, 22 Nov 2001 16:15:34 +0000 (16:15 +0000)
comedi/drivers/ni_labpc.c

index 6a385493a98b25e4ff2b2d9e42852ecc9511e4aa..2eb516d1f8bf015f4f5a874b909e060aeccf382f 100644 (file)
@@ -893,11 +893,21 @@ static int labpc_ai_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_cmd *c
                        cmd->convert_arg = thisboard->ai_speed;
                        err++;
                }
-               // make sure scan timing is not too fast
-               if(cmd->scan_begin_src == TRIG_TIMER)
+       }
+
+       // make sure scan timing is not too fast
+       if(cmd->scan_begin_src == TRIG_TIMER)
+       {
+               if(cmd->convert_src == TRIG_TIMER &&
+                       cmd->scan_begin_arg < cmd->convert_arg * cmd->chanlist_len)
                {
-                       if(cmd->scan_begin_arg < cmd->convert_arg * cmd->chanlist_len)
-                               cmd->scan_begin_arg = cmd->convert_arg * cmd->chanlist_len;
+                       cmd->scan_begin_arg = cmd->convert_arg * cmd->chanlist_len;
+                       err++
+               }
+               if(cmd->scan_begin_arg < thisboard->ai_speed * cmd->chanlist_len)
+               {
+                       cmd->convert_arg = thisboard->ai_speed * cmd->chanlist_len;
+                       err++;
                }
        }