cancel
Showing results for 
Search instead for 
Did you mean: 

one more STR library bug found! routine ADC_GetAnalogWatchdogResult()

software2
Associate II
Posted on May 23, 2007 at 13:53

one more STR library bug found! routine ADC_GetAnalogWatchdogResult()

1 REPLY 1
software2
Associate II
Posted on May 17, 2011 at 09:43

Lack of parenthesis in the function ADC_GetAnalogWatchdogResult() causes wrong test result!

This is because the != operator has precedence over the & operator (see K&R).

Change the first line of the function as follows:

if ( (ADC->CRR & (1 << ADC_Channel)) != RESET)

Take care