Due_CAN Question for Collin


I am setting up a controller for a test station that will need to power-up and power-down the device it is testing, and support CAN communications with the device. The device being tested has 11 different messages that it sends, and I have configured those into 4 groups, using 4 mailboxes.

At any rate, it looks to me that if I setup the mailbox filters, callback functions, and then exit begin/init, the mailbox settings all get cleared, except that the number of TX mailboxes would seem to remain. Since I do not want to go online on the CAN bus until the point in time where the DUT is powered up, I would prefer to not have init enable the CAN channel. So I simply modified your library to remove the enable from the init method.

I'm curious as to whether or not there is any downside to this? I suppose I could have also simply left the library alone, and ran the following sequence instead:

  • Set number of TX mailboxes
  • Begin
  • Disable
  • Set RX filters
  • Disable Time-Triggered Mode (couldn't tell what the default is)
  • Setup callbacks
  • Enable

The way I am currently planning I can skip the disable. I also eliminated the loop waiting for WAKEUP bit to be set, thought about adding it to the enable method but returns a void anyways, so what's the point, and changing all the things in order for it to return a value seemed more work than it was worth.

I won't be able to test what I've implemented until next week, thought I might get your thoughts on this if you see this post before then.

Thanks a bunch - kudos for an awesome library set, by the way!