Fix a little buglet in cmd_test
authorDavid Schleef <ds@schleef.org>
Sat, 14 Jul 2001 21:39:24 +0000 (21:39 +0000)
committerDavid Schleef <ds@schleef.org>
Sat, 14 Jul 2001 21:39:24 +0000 (21:39 +0000)
comedi/drivers/das16.c

index ab833cddbc0e1b5b67eb13c958fa3bc0c0e9fb3c..c82aadf8e51b918b9a538a2abb5b1fbbac313c09 100644 (file)
@@ -704,17 +704,21 @@ static int das16_cmd_test(comedi_device *dev,comedi_subdevice *s, comedi_cmd *cm
        // step 4: fix up arguments
        if(cmd->scan_begin_src == TRIG_TIMER)
        {
+               unsigned int tmp = cmd->scan_begin_arg;
                // set divisors, correct timing arguments
-               i8253_cascade_ns_to_timer_2div(devpriv->clockbase, &(devpriv->divisor1),
-                       &(devpriv->divisor2), &(cmd->scan_begin_arg), cmd->flags & TRIG_ROUND_MASK);
-               err++;
+               i8253_cascade_ns_to_timer_2div(devpriv->clockbase,
+                       &(devpriv->divisor1), &(devpriv->divisor2),
+                       &(cmd->scan_begin_arg), cmd->flags & TRIG_ROUND_MASK);
+               err += (tmp!=cmd->scan_begin_arg);
        }
        if(cmd->convert_src == TRIG_TIMER)
        {
+               unsigned int tmp = cmd->convert_arg;
                // set divisors, correct timing arguments
-               i8253_cascade_ns_to_timer_2div(devpriv->clockbase, &(devpriv->divisor1),
-                       &(devpriv->divisor2), &(cmd->convert_arg), cmd->flags & TRIG_ROUND_MASK);
-               err++;
+               i8253_cascade_ns_to_timer_2div(devpriv->clockbase,
+                       &(devpriv->divisor1), &(devpriv->divisor2),
+                       &(cmd->convert_arg), cmd->flags & TRIG_ROUND_MASK);
+               err += (tmp!=cmd->convert_arg);
        }
        if(err)return 4;