Author Topic: Does anyone recognize this data protocol?  (Read 2776 times)

0 Members and 1 Guest are viewing this topic.

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12068
  • Country: gb
    • Mike's Electric Stuff
Re: Does anyone recognize this data protocol?
« Reply #25 on: October 19, 2018, 09:48:06 pm »

  bit13 = (x >> 13) & 1 == 1 ? high : low;
 
Unless the compiler is quite clever, shifting the constant mask will be more efficient than shifting the value as it's done at compile time.
i.e. bit13 = ( x & (1<<13)) ? high : low;

Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf