Re: channel sequence problem with NI-6251

On Tue, Feb 20, 2007 at 07:52:34PM +0100, Edwin Steiner wrote:
> The problem is that in ni_m_series_load_channelgain_list config_bits
> is not reset to 0 in the loop over the channels.
> 
> I'll check if this is missing in current CVS, too, and send a patch
> if so.

Here is the patch against current CVS HEAD:

---

Fixed bug in NI M-Series channel list setup.

In ni_m_series_load_channelgain_list, the variable config_bits
was not reset in the channel loop. Thus configuration words for
channels later in the list were messed up.

Index: comedi/drivers/ni_mio_common.c
===================================================================
RCS file: /cvs/comedi/comedi/comedi/drivers/ni_mio_common.c,v
retrieving revision 1.291
diff -u -p -r1.291 ni_mio_common.c
--- comedi/drivers/ni_mio_common.c	12 Jan 2007 19:55:19 -0000	1.291
+++ comedi/drivers/ni_mio_common.c	20 Feb 2007 19:06:44 -0000
_at__at_ -1440,7 +1440,7 _at__at_ static void ni_m_series_load_channelgain
 {
 	unsigned int chan, range, aref;
 	unsigned int i;
-	unsigned config_bits = 0;
+	unsigned config_bits;
 	unsigned offset;
 	unsigned int dither;
 	unsigned range_code;
_at__at_ -1481,6 +1481,8 _at__at_ static void ni_m_series_load_channelgain
 		range_code = ni_gainlkup[boardtype.gainlkup][range];
 		devpriv->ai_offset[i] = offset;
 
+		config_bits = 0;
+
 		switch( aref )
 		{
 			case AREF_DIFF:

Received on 2007-02-20Z19:07:19