cancel
Showing results for 
Search instead for 
Did you mean: 

Possibly I've found a bug in std library for STR7...

0xef15h
Associate
Posted on May 31, 2007 at 13:30

Possibly I've found a bug in std library for STR7...

3 REPLIES 3
0xef15h
Associate
Posted on May 12, 2007 at 09:37

Look at this code in adc12.h:

inline void ADC12_ChannelSelect(ADC12_Channels ADC12_Channel)

{

/* Update the CSR by the value of the selected channel */

ADC12->CSR |= ADC12_Channel;

}

It's impossible to select channel 0 after seelcting channel 1,

without manual clearing of some bits in CSR.

Should be rewrited as:

ADC12->CSR = (ADC12->CSR & ~(ADC_all_channels_mask)) | ADC12_Channel;

Am I right or not?

sofiene
Associate III
Posted on May 14, 2007 at 06:43

Yes you are right:

We have already detected this problem and the bug will be corrected in the next library version and the correction will be:

void ADC12_ChannelSelect(ADC12_Channels ADC12_Channel)

{

/* Clear present selected channel */

ADC12->CSR &= 0xFFCF;

/* Update the CSR by the value of the selected channel */

ADC12->CSR |= ADC12_Channel;

}

Thanks.

[ This message was edited by: M3allem on 14-05-2007 10:56 ]

kaouther
Associate II
Posted on May 31, 2007 at 13:30

Yes, we confirm. thanks for your information.