View previous topic :: View next topic |
Author |
Message |
g@rd3n3r
Joined: 14 Jul 2016 Posts: 2
|
can_putd |
Posted: Tue Nov 14, 2017 2:56 pm |
|
|
revisiting after a long haitus.
can_putd(int32 id, int * data, int len,int priority, int1 ext, int1 rtr);
question about priority. The lower the value the higher the priority the message will be, right? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19518
|
|
Posted: Tue Nov 14, 2017 3:39 pm |
|
|
No. The message with the _lowest_ priority is postponed in the event of a conflict.
Read the comments in the driver itself:
Quote: |
// priority - priority of message. The higher the number, the
// sooner the CAN peripheral will send the message.
// Numbers 0 through 3 are valid.
|
0 to 3 only. 3 is the highest priority, 0 the lowest.
This is standard on CAN itself. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Tue Nov 14, 2017 4:42 pm |
|
|
As Ttelmah has said, this is an internal (to the CAN peripheral) priority which is used to determine which message (if more than one), gets routed to the TX circuitry when a transmit slot opens up on the CAN bus.
For things like J1939 and/or NMEA 2000, you're correct in that the priority there corresponds to the first 3 bits transmitted on the CAN bus, and in that instance, the number of dominant/recessive bits determines who "wins" if more than one device attempt to simultaneously transmit on the bus. |
|
|
|