Forum Rule: Always post complete source code & details to reproduce any issue!
-
Flexcan - what does this line do?
I'm trying to learn some of the Flexcan features and would like to understand what this line in the global section actually does in laymans terms.
Code:
static CAN_message_t msg;
It is sometimes as above and sometimes ends msg, rxmsg;. What does the extra rxmsg do?
-
Receive message, its just a struct with the id, data, etc
-
Thanks, but it's still a little over my head. Can you explain 'struct' to me?
-
Its basically like a container that has multiple variables.
As an example above, these work:
msg.id;
msg.buf[0];
msg.flags.extended,
-
Ok thanks, so presumably if you had inMsg in you struct you'd use inMsg.id; etc.
Why might you need two containers such as msg, rxmsg then
-

Originally Posted by
keith-i
Ok thanks, so presumably if you had inMsg in you struct you'd use inMsg.id; etc.
Why might you need two containers such as msg, rxmsg then
msg use in transmit function.
rxmsg use in receive function.
-
So does it matter what name you use or is it just rxmsg to help recognise it as a receive function. Could you say use txmsg instead of msg?
-
Name can be anything you want it to be, like a variable, yeah
Txmsg is an example to let you know its a transmit message
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules