There is a bug which reveals itself on 16 or 32 bit MPUs. RAW acceleration is returned via 2 8-bit registers, but is signed, and 2's complement encoded. Registers are mapped as uint8_t (unsigned 8-bit), which is fine, but they are bitshifted and ORed together and assigned to float variable.
xha << 8 | xla creates xa, but it's type is uint16_t, while it should be int16_t... both can be assigned to float variable, but only second one is valid.
There is a bug which reveals itself on 16 or 32 bit MPUs. RAW acceleration is returned via 2 8-bit registers, but is signed, and 2's complement encoded. Registers are mapped as uint8_t (unsigned 8-bit), which is fine, but they are bitshifted and ORed together and assigned to float variable. xha << 8 | xla creates xa, but it's type is uint16_t, while it should be int16_t... both can be assigned to float variable, but only second one is valid.
Is:
Should be: