From: Frank Mori Hess Date: Sat, 29 Sep 2007 00:01:47 +0000 (+0000) Subject: Fixed use of ai channels >= 64 on 6225. Based on patch from X-Git-Tag: r0_7_75~30 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=925090b605a7e896607d9c25e419774a240cafb8;p=comedi.git Fixed use of ai channels >= 64 on 6225. Based on patch from Ingmar Schoegl . --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 552a4c6f..b3c68e95 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -1795,7 +1795,7 @@ static void ni_m_series_load_channelgain_list(comedi_device *dev,unsigned int n_ break; } config_bits |= MSeries_AI_Config_Channel_Bits(chan); - config_bits |= MSeries_AI_Config_Bank_Bits(chan); + config_bits |= MSeries_AI_Config_Bank_Bits(boardtype.reg_type, chan); config_bits |= MSeries_AI_Config_Gain_Bits(range_code); if(i == n_chan - 1) config_bits |= MSeries_AI_Config_Last_Channel_Bit; if(dither) config_bits |= MSeries_AI_Config_Dither_Bit; diff --git a/comedi/drivers/ni_stc.h b/comedi/drivers/ni_stc.h index e544d8d3..a2184514 100644 --- a/comedi/drivers/ni_stc.h +++ b/comedi/drivers/ni_stc.h @@ -1142,9 +1142,15 @@ static inline unsigned MSeries_AI_Config_Channel_Bits(unsigned channel) { return channel & 0xf; } -static inline unsigned MSeries_AI_Config_Bank_Bits(unsigned channel) +static inline unsigned MSeries_AI_Config_Bank_Bits(enum ni_reg_type reg_type, unsigned channel) { - return channel & 0x30; + unsigned bits = channel & 0x30; + if(reg_type == ni_reg_622x) + { + if(channel & 0x40) + bits |= 0x400; + } + return bits; } static inline unsigned MSeries_AI_Config_Gain_Bits(unsigned range) {