From fc65c441f9b379716e51304e1b08b318fcb0df83 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 22 Nov 2001 16:20:24 +0000 Subject: [PATCH] fixed error in calculating counter a0 and b1 values --- comedi/drivers/ni_labpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.26.2