Skip to main content
Visitor II
May 23, 2007
Question

one more STR library bug found! routine ADC_GetAnalogWatchdogResult()

  • May 23, 2007
  • 1 reply
  • 522 views
Posted on May 23, 2007 at 13:53

one more STR library bug found! routine ADC_GetAnalogWatchdogResult()

    This topic has been closed for replies.

    1 reply

    software2Author
    Visitor II
    May 17, 2011
    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