Patch from terry1@beam.ltd.uk (Terry Barnaby):
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 19 Apr 2006 02:10:10 +0000 (02:10 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 19 Apr 2006 02:10:10 +0000 (02:10 +0000)
There was a bug in the PCI-6143 code in the ni_pcimio driver which stopped
the device being set to high sampling rates.
The enclosed patch fixes this.

comedi/drivers/ni_mio_common.c

index 0e72d7c35a18d45bd5d6461f69b424b631055ec0..3277cf532a3bae07c9b0a27b78d8798cbb8cfd70 100644 (file)
@@ -1658,7 +1658,7 @@ static int ni_ai_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_cmd *cmd)
 
        tmp=cmd->convert_src;
        sources = TRIG_TIMER | TRIG_EXT;
-       if(boardtype.reg_type == ni_reg_611x) sources |= TRIG_NOW;
+       if((boardtype.reg_type == ni_reg_611x) || (boardtype.reg_type == ni_reg_6143)) sources |= TRIG_NOW;
        cmd->convert_src &= sources;
        if(!cmd->convert_src || tmp!=cmd->convert_src)err++;
 
@@ -1734,7 +1734,7 @@ static int ni_ai_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_cmd *cmd)
                }
        }
        if(cmd->convert_src==TRIG_TIMER){
-               if(boardtype.reg_type == ni_reg_611x){
+               if((boardtype.reg_type == ni_reg_611x) || (boardtype.reg_type == ni_reg_6143)){
                        if(cmd->convert_arg != 0){
                                cmd->convert_arg = 0;
                                err++;
@@ -1801,7 +1801,7 @@ static int ni_ai_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_cmd *cmd)
                if(tmp!=cmd->scan_begin_arg)err++;
        }
        if(cmd->convert_src==TRIG_TIMER){
-               if(boardtype.reg_type != ni_reg_611x){
+               if((boardtype.reg_type != ni_reg_611x) && (boardtype.reg_type != ni_reg_6143)){
                        tmp=cmd->convert_arg;
                        ni_ns_to_timer(&cmd->convert_arg,cmd->flags&TRIG_ROUND_MASK);
                        if(tmp!=cmd->convert_arg)err++;