From bb549211740a2a959169b0ecf7322dff3a70ecb9 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 25 Nov 2002 20:13:55 +0000 Subject: [PATCH] fix rejection of CONFIG_ALT_SOURCE insn for 611x --- comedi/drivers/ni_mio_common.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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; -- 2.26.2