-
Notifications
You must be signed in to change notification settings - Fork 0
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
CAN 2.0B Driver changes #69
Conversation
It have been moved to rocketlib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can u add more comments for the bitshifting? make it more maintainable if someone else needs to debug it or anything.
rcvd_msg.sid = (uint32_t)RXB1SIDH << 21; | ||
rcvd_msg.sid |= (((uint32_t)RXB1SIDL >> 5) & 0x7) << 18; | ||
rcvd_msg.sid |= ((uint32_t)RXB1SIDL & 0x3) << 16; | ||
rcvd_msg.sid |= (uint32_t)RXB1EIDH << 8; | ||
rcvd_msg.sid |= RXB1EIDL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add more comments so we know what this is doing at a glance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can put a link to datasheet if you want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was thinking smth like "store the [N:n] bits from rxb1eid into sid" or something like that to describe the bit shifting. unless its really easy to interpret these 5 bitwise ops and im just skill issuing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding datasheet page number is probably good enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
Update CAN driver only, update SID will be done in a separate PR