I was saying to myself "What the world needs is yet another fork of the FlexCAN library" so, I did that.
https://github.com/collin80/FlexCAN_Library
This is a fork of a fork (I forked Pawelsky's version and Pawelsky forked Teachop's version).
People who liked the library the way it was will want to look away. I changed an awful lot. It is almost possible to use existing code as-is but some assumptions need to be re-evaluated and library initialization is completely different. Essentially I took my work on the due_can library and moved it over the FlexCAN. That means fully interrupt driven Rx and Tx of CAN frames and the ability to register callbacks so that your code gets messages immediately when they come in without any polling. due_can supported doing this both in C code and with C++ classes. I didn't bring over the C code version of callbacks because I'm trying not to over complicate the FlexCAN library. So, it's kind of like due_can but with less complication. Not everything has been well tested yet (and I haven't updated the readme file or anything) but there are two new examples and I have tested it to be stable while sending and receiving very high bus loads. Filtering will be a little odd yet but it defaults to allowing all frames through so mostly the filtering could be ignored for now.
This version of the library is much larger and more complicated than before. This brings with it additional code and RAM bloat. If you were pushing the limits before you might not like that. But, it's only about 3k in code and 2k in RAM.
I have only tested on Teensy 3.6 hardware but all the defines are in there and it should work on all the Teensy 3.x boards.
I'll work on updating the readme to match the new format. I'm open for suggestions on what you'd like to see in this version of the FlexCAN library. I know Paul would like the CAN libraries across multiple architectures to match in API. I suppose being that my repos have three different platforms (teensy, due, mcp2515 on AVR) I would be in a good position to do that if I weren't running out of round tuits.
https://github.com/collin80/FlexCAN_Library
This is a fork of a fork (I forked Pawelsky's version and Pawelsky forked Teachop's version).
People who liked the library the way it was will want to look away. I changed an awful lot. It is almost possible to use existing code as-is but some assumptions need to be re-evaluated and library initialization is completely different. Essentially I took my work on the due_can library and moved it over the FlexCAN. That means fully interrupt driven Rx and Tx of CAN frames and the ability to register callbacks so that your code gets messages immediately when they come in without any polling. due_can supported doing this both in C code and with C++ classes. I didn't bring over the C code version of callbacks because I'm trying not to over complicate the FlexCAN library. So, it's kind of like due_can but with less complication. Not everything has been well tested yet (and I haven't updated the readme file or anything) but there are two new examples and I have tested it to be stable while sending and receiving very high bus loads. Filtering will be a little odd yet but it defaults to allowing all frames through so mostly the filtering could be ignored for now.
This version of the library is much larger and more complicated than before. This brings with it additional code and RAM bloat. If you were pushing the limits before you might not like that. But, it's only about 3k in code and 2k in RAM.
I have only tested on Teensy 3.6 hardware but all the defines are in there and it should work on all the Teensy 3.x boards.
I'll work on updating the readme to match the new format. I'm open for suggestions on what you'd like to see in this version of the FlexCAN library. I know Paul would like the CAN libraries across multiple architectures to match in API. I suppose being that my repos have three different platforms (teensy, due, mcp2515 on AVR) I would be in a good position to do that if I weren't running out of round tuits.