Seeed-Studio/CAN_BUS_Shield — pull request #3 by woodward1 (2014-03-07 19:44:42+00:00)
Title: fixed corrupted can id bug

There was an error in the bit arithmatic for the can id.

Basically, if the 15th bit of the id was set, then the upper 16bits were 1 less than they should be.
e.g. 0x0001(8-F)XXX -> 0x0000(8-F)XXX
e.g. 0x0000(8-F)XXX -> 0xFFFF(8-F)XXX

The offending operation is (tbufdata[MCP_EID8]<<8). This promotes an unsigned char to a signed int, which results in the corrupted ids. The fix is to cast it to an unsigned int. Note that int's are 16 bit on avr.