From: Frank Mori Hess Date: Thu, 22 Nov 2001 16:20:24 +0000 (+0000) Subject: fixed error in calculating counter a0 and b1 values X-Git-Tag: r0_7_62~94 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fc65c441f9b379716e51304e1b08b318fcb0df83;p=comedi.git fixed error in calculating counter a0 and b1 values --- diff --git a/comedi/drivers/ni_labpc.c b/comedi/drivers/ni_labpc.c index 2eb516d1..3744e605 100644 --- a/comedi/drivers/ni_labpc.c +++ b/comedi/drivers/ni_labpc.c @@ -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;