macchina / mcp2515

Library to facilitate CAN functionality with the onboard MCP2515 CAN controller
GNU Lesser General Public License v2.1
45 stars 22 forks source link

Does this library have any applicabilty to the Macchina M2? #5

Closed adamvoss closed 7 years ago

adamvoss commented 7 years ago

This is the only bit of code that I have come across that I know to be targeting the Macchina v1.1 and I know there was some discussion about moving this under the macchina GitHub organization. Asking to know whether it should be clarified this is for an older Macchina product.

adamvoss commented 7 years ago

/cc @rocketjosh

collin80 commented 7 years ago

The answer is kind of complicated. Technically the M2 uses an MCP2515 for the single wire CAN. It appears that the MCP2515 project was forked for SW_CAN (looks like almost the same code to me) but SW_CAN adds a little bit of SWCAN magic on top. So, at the moment there is no applicability to the M2 as everything is duplicated into SW_CAN. However, the SWCAN stuff is done by inheriting from the MCP2515 class. So, I don't see any reason why the SW_CAN library couldn't use the MCP2515 library and just continue to inherit the class and extend it. This would remove the duplication and make this project applicable to the M2. It would also drastically shrink the SW_CAN library.

One last bit of caution - technically the SW_CAN code has a modified and upgraded version of the code from MCP2515 so really that code should be merged back into MCP2515 and then removed from SW_CAN. That is, if that is the direction Macchina decides to go. It's always possible to just leave it all as it is.

collin80 commented 7 years ago

This library most definitely is applicable to the M2 now. Closing the issue.