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

Small bug in can_rx_mode() #5

Open
billforsternz opened this issue Dec 19, 2022 · 0 comments
Open

Small bug in can_rx_mode() #5

billforsternz opened this issue Dec 19, 2022 · 0 comments

Comments

@billforsternz
Copy link

On line 508 of mcp2515.c;

can_w_bit(MCP2515_RXB0CTRL + rxb*0x10, MCP2515_RXB0CTRL_RXM0 | MCP2515_RXB0CTRL_RXM0, mode);

Should be;

can_w_bit(MCP2515_RXB0CTRL + rxb*0x10, MCP2515_RXB0CTRL_RXM1 | MCP2515_RXB0CTRL_RXM0, mode);

Reason; This function is intended for setting a 2 bit field to one of 4 values, so the mask parameter should be constructed from two single bit masks. Looks like a typo / copy/paste error.

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

No branches or pull requests

1 participant