Why make a bitshift operation on a fixed value ?
Posted: Fri Jan 04, 2019 11:07 pm
Hello,
I'm tinkering with some code, looking how it works in libraries, it is a library for dmx, the light communication protocol, a serial communication, over rs 485 connection.
I often see this kind of code :
U0IS is the interrupter status, and UIBD a kind of interrupter.
I don't understand why the 1 is at left the variable at right, can someone explains me why ?
Thanks, and happy new year
I'm tinkering with some code, looking how it works in libraries, it is a library for dmx, the light communication protocol, a serial communication, over rs 485 connection.
I often see this kind of code :
Code: Select all
if ((U0IS & (1 << UIBD)))
U0IS is the interrupter status, and UIBD a kind of interrupter.
I don't understand why the 1 is at left the variable at right, can someone explains me why ?
Thanks, and happy new year