cancel
Showing results for 
Search instead for 
Did you mean: 

notation

esiqueira
Associate II
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
2 REPLIES 2
frankmeyer9
Associate II
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
Associate II
Posted on June 27, 2012 at 15:24

THANKS fm