Skip to main content
esiqueira
Associate III
June 27, 2012
Question

notation

  • June 27, 2012
  • 2 replies
  • 546 views
Posted on June 27, 2012 at 14:51

Whats the difference about

NVIC_SetPriority(TIMER0_IRQn, ((0x01<<3)|0x01));

and

NVIC_SetPriority(TIMER0_IRQn, 9);

 

Is There a special motive to use the first form??????

THANKS

#notation
    This topic has been closed for replies.

    2 replies

    frankmeyer9
    Associate III
    June 27, 2012
    Posted on June 27, 2012 at 15:10

    Is There a special motive to use the first form??????

     

    Possibly obfuscation.

    It would make sense to use constants/defines with speaking names, to express one's intentions.

    And with an optimization level set to >0, a good compiler will emit the same code for both notations.

    esiqueira
    esiqueiraAuthor
    Associate III
    June 27, 2012
    Posted on June 27, 2012 at 15:24

    THANKS fm