Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting MCP2515 mask and filter registers directly, as well as control rollover #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

timurrrr
Copy link

Add MCP2515::setFilterRegisters() to allow setting mask and filter registers
directly, as well as control rollover

This provides a much greater flexibility than just one mask and filter pair.

While at it, fix incorrect REG_RXFn* macros, and add TODOs for a couple more
places in the code related to filtering that seem to violate the datasheet.

…gisters directly, as well as control rollover

This provides a much greater flexibility than just one mask and filter pair.

While at it, fix incorrect REG_RXFn* macros, and add TODOs for a couple more
places in the code related to filtering that seem to violate the datasheet.
Comment on lines +293 to +295
// TODO: This doesn't look correct. According to the datasheet, the RXM0 and
// RMX1 should either both be unset (in which case filters are active), or
// both be unset (in which case all filters are ignored).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a hangover from the MCP2510 which is no longer (officially) supported by the MCP2515. See https://i.imgur.com/QmthNtj.png vs https://i.imgur.com/sGE2jpq.png

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding this!
I suspect it's just a typo and the intention was to use FLAG_RXM1 on L292 (old).
But at the same time I don't want to change code that I don't fully understand, and didn't spend enough time testing. The PR as-is is already an improvement, and hopefully with the TODO someone else (or future me) will be curious to figure out how to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants