Browse Source

doc: CAN: Fix code in CAN API documentation

Fix code sections in the doc.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
pull/31418/head
Alexander Wachter 5 years ago committed by Anas Nashif
parent
commit
f0145f9f3e
  1. 9
      doc/reference/networking/can_api.rst

9
doc/reference/networking/can_api.rst

@ -155,13 +155,12 @@ a mailbox. When a transmitting mailbox is assigned, sending cannot be canceled. @@ -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. @@ -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…
Cancel
Save