doc: CAN: Fix code in CAN API documentation
Fix code sections in the doc. Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
This commit is contained in:
parent
c8cbf0177a
commit
f0145f9f3e
1 changed files with 5 additions and 4 deletions
|
@ -155,13 +155,12 @@ a mailbox. When a transmitting mailbox is assigned, sending cannot be canceled.
|
|||
.id_type = CAN_STANDARD_IDENTIFIER,
|
||||
.rtr = CAN_DATAFRAME,
|
||||
.id = 0x123,
|
||||
.dlc = 8
|
||||
.dlc = 8,
|
||||
.data = {1,2,3,4,5,6,7,8}
|
||||
};
|
||||
const struct device *can_dev;
|
||||
int ret;
|
||||
|
||||
frame.data = {1,2,3,4,5,6,7,8};
|
||||
|
||||
can_dev = device_get_binding("CAN_0");
|
||||
|
||||
ret = can_send(can_dev, &frame, K_MSEC(100), NULL, NULL);
|
||||
|
@ -196,7 +195,9 @@ occurred. It does not block until the message is sent like the example above.
|
|||
.dlc = 2
|
||||
};
|
||||
|
||||
frame.data = {1,2};
|
||||
frame.data[0] = 1;
|
||||
frame.data[1] = 2;
|
||||
|
||||
return can_send(can_dev, &frame, K_FOREVER, tx_irq_callback, "Sender 1");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue