fixed error in calculating counter a0 and b1 values
authorFrank Mori Hess <fmhess@speakeasy.net>
Thu, 22 Nov 2001 16:20:24 +0000 (16:20 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Thu, 22 Nov 2001 16:20:24 +0000 (16:20 +0000)
comedi/drivers/ni_labpc.c

index 2eb516d1f8bf015f4f5a874b909e060aeccf382f..3744e605c1159daec64d11707b051b381394d503 100644 (file)
@@ -1707,12 +1707,12 @@ static void labpc_adc_timing(comedi_device *dev, comedi_cmd *cmd)
                {
                        default:
                        case TRIG_ROUND_NEAREST:
-                               devpriv->divisor_a0 = cmd->convert_arg + (base_period / 2) / base_period;
-                               devpriv->divisor_b1 = cmd->scan_begin_arg + (base_period / 2) / base_period;
+                               devpriv->divisor_a0 = (cmd->convert_arg + (base_period / 2)) / base_period;
+                               devpriv->divisor_b1 = (cmd->scan_begin_arg + (base_period / 2)) / base_period;
                                break;
                        case TRIG_ROUND_UP:
-                               devpriv->divisor_a0 = cmd->convert_arg + (base_period - 1) / base_period;
-                               devpriv->divisor_b1 = cmd->scan_begin_arg + (base_period - 1) / base_period;
+                               devpriv->divisor_a0 = (cmd->convert_arg + (base_period - 1)) / base_period;
+                               devpriv->divisor_b1 = (cmd->scan_begin_arg + (base_period - 1)) / base_period;
                                break;
                        case TRIG_ROUND_DOWN:
                                devpriv->divisor_a0 = cmd->convert_arg  / base_period;