-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add support for 29 bit identifier #1
Comments
Same problem here. Do you still have this code? |
I have a 29 bit branch here, also changed to c++, but it should be split into separate commits. Haven't touched it for a couple years though. https://github.com/danjo133/SparkFun_CAN-Bus_Arduino_Library |
Thanks for the reply!! I'll give it a go. I'm assuming the usage hasn't changed. |
Not that I remember, just check extended flag in tCAN on receive and set it on send. |
@danjo133 Your implementation misidentifies all incoming frames as extended. I've fixed it in my branch: https://github.com/bessman/SparkFun_CAN-Bus_Arduino_Library |
Good to know, thanks! |
Hi,
I need to have support for 29 bit identifiers in a project I'm working on.
I have working code for it that I would like to contribute, but I'm unsure what the best way of handling the 11 vs 29 bit difference.
I have added a bool for keeping track of if it's a 29 or 11 bit identifier
typedef struct
{
uint32_t id;
struct {
int8_t rtr : 1;
uint8_t length : 4;
} header;
uint8_t data[8];
bool extended;
} tCAN;
I would like to keep all old code working though, and I have two suggestions. Either change the mcp2515.c to .cpp which would allow constructors that set default extended=false or add a new struct for extended messages. Do you have any other suggestion?
The text was updated successfully, but these errors were encountered: