From: Frank Mori Hess Date: Sat, 1 Jun 2002 23:03:55 +0000 (+0000) Subject: added check in command test for peculiar restrictions on pcidas-4020 chanlists X-Git-Tag: r0_7_65~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2ec4a0f3b91c3dc28f7a951194a7867cdb5b6480;p=comedi.git added check in command test for peculiar restrictions on pcidas-4020 chanlists --- diff --git a/comedi/drivers/cb_pcidas64.c b/comedi/drivers/cb_pcidas64.c index 3db855b8..dba5bf8d 100644 --- a/comedi/drivers/cb_pcidas64.c +++ b/comedi/drivers/cb_pcidas64.c @@ -1504,7 +1504,25 @@ static int ai_cmdtest(comedi_device *dev,comedi_subdevice *s, comedi_cmd *cmd) break; } } - // XXX check 4020 chanlist + // check 4020 chanlist + if( board(dev)->layout == LAYOUT_4020 ) + { + unsigned int first_channel = CR_CHAN( cmd->chanlist[0] ); + for( i = 1; i < cmd->chanlist_len; i++ ) + { + if( CR_CHAN( cmd->chanlist[ i ] ) != first_channel + i ) + { + comedi_error( dev, "chanlist must use consecutive channels" ); + err++; + break; + } + } + if( cmd->chanlist_len == 3 ) + { + comedi_error( dev, "chanlist cannot be 3 channels long, use 1, 2, or 4 channels" ); + err++; + } + } } if(err) return 5;