sparkfun/MMA8452_Accelerometer — pull request #8 by billpugh (2014-04-16 22:10:31+00:00)
Title: Fix code for handling sign extension of negative 12-bit values.

Previous code was incorrect; this code is also faster and simpler

Example:
gCount = 0xfff.

Old code:
~gCount = 0xf000
~gCount + 1 = 0xf001
- ( ~gCount + 1 ) = 0x1001

New code:
0xfff - 0x1000 = 0xffff