Commit Graph
2 Commits
Author SHA1 Message Date
woodward1 43d936ddf3 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.
2014-03-07 11:43:52 -08:00
reeedstudio 94edfca904 update 2014-01-02 11:50:38 +08:00