From d35ed5f0efd622e02e79c1206c0d856d941c8457 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 22 Nov 2001 16:15:34 +0000 Subject: [PATCH] fix to cmdtest --- comedi/drivers/ni_labpc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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++; } } -- 2.26.2