From: Frank Mori Hess Date: Thu, 22 Nov 2001 16:15:34 +0000 (+0000) Subject: fix to cmdtest X-Git-Tag: r0_7_62~95 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d35ed5f0efd622e02e79c1206c0d856d941c8457;p=comedi.git fix to cmdtest --- diff --git a/comedi/drivers/ni_labpc.c b/comedi/drivers/ni_labpc.c index 6a385493..2eb516d1 100644 --- a/comedi/drivers/ni_labpc.c +++ b/comedi/drivers/ni_labpc.c @@ -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++; } }