Longan-Labs / Longan_CANFD

Arduino library for CAN-FD Shield, base on MCP2517FD/MCP2518FD and MCP2542
MIT License
23 stars 15 forks source link

Problem by receiving extended identifiers #4

Closed martin7BF closed 2 years ago

martin7BF commented 3 years ago

Hello to everyone,

I use this library for reading a can-bus of a lorry/truck. But the extended identifiers bigger than 3FFFF could not be shown right. Their is a mistake in "mcp2518fd_can.cpp" line 2144:

can_id = ext_flg? (rxObj.bF.id.EID | (rxObj.bF.id.SID << 18)) : rxObj.bF.id.SID;

should be:

can_id = ext_flg? (rxObj.bF.id.EID | ((uint32_t) rxObj.bF.id.SID << 18)) : rxObj.bF.id.SID;

Everythink else is working fine, and I want to thank you for our work, wirting this library. (And please excause my english)

stephen1874 commented 2 years ago

thanks for sharing.