Skip to main content
lil-vince
Associate III
January 17, 2009
Question

ST librairy syntax

  • January 17, 2009
  • 2 replies
  • 696 views
Posted on January 17, 2009 at 10:14

ST librairy syntax

    This topic has been closed for replies.

    2 replies

    lil-vince
    lil-vinceAuthor
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:59

    Hi all,

    I´ve a probably stupid question but I prefer to be sure:

    Is there a difference between this two syntax for a if statement:

    ST use this statement in their librairy (for example):

    if ((ADCx->CR2 & CR2_CAL_Set) != (u32)RESET)

    or

    if ((ADCx->SR & ADC_FLAG) != (u8)RESET)

    And I used to write like this:

    if ((ADCx->CR2 & CR2_CAL_Set))

    Because I prefer my syntax, I would like to know if there is a reason to write like ST (code size/speed)?

    Thanks

    trevor1
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:59

    no difference, just a matter of style.