From: Frank Mori Hess Date: Mon, 25 Nov 2002 20:13:55 +0000 (+0000) Subject: fix rejection of CONFIG_ALT_SOURCE insn for 611x X-Git-Tag: r0_7_67x~157 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bb549211740a2a959169b0ecf7322dff3a70ecb9;p=comedi.git fix rejection of CONFIG_ALT_SOURCE insn for 611x --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 9b5a9d7c..9476b2cb 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -1812,14 +1812,16 @@ static int ni_ai_insn_config(comedi_device *dev,comedi_subdevice *s, break; case INSN_CONFIG_ALT_SOURCE: { - if(data[1] >= 8) - return -EINVAL; - devpriv->ai_calib_source = data[1] & 0xf; - if( boardtype.reg_611x ) - { - unsigned int calib_source_adjust; + unsigned int calib_source; + unsigned int calib_source_adjust; - calib_source_adjust = ( data[1] >> 4 ) & 0xff; + calib_source = data[1] & 0xf; + calib_source_adjust = ( data[1] >> 4 ) & 0xff; + + if(calib_source >= 8) + return -EINVAL; + devpriv->ai_calib_source = calib_source; + if( boardtype.reg_611x ){ ni_writeb( calib_source_adjust, Cal_Gain_Select_611x ); } return 2;