autowp / arduino-mcp2515

Arduino MCP2515 CAN interface library
MIT License
793 stars 279 forks source link

Allowing to pass a custom SPI object #53

Closed FStefanni closed 2 years ago

FStefanni commented 3 years ago

Hi,

at the moment it is not possible to pass a custom SPI instance to the MCP2515 constructor. I had this need in a project, so I have made the change on a local copy. If you think this could be useful to others, I can provide a pull request.

Regards.

autowp commented 3 years ago

Sounds great. How its looks like?

FStefanni commented 3 years ago

Just an optional parameter to the constructor, a new class member, and few code replacements. So, it is backward compatible, since as default it will use the default SPI instance. I am going to provide the pr, so you can check the code.