Hi guys, I'm using 5746R to receive CAN SDK data, here's the struct from can_pal.h file.
I want to trans SDK data to a array. But when debugging, I can't trans data to array successfully. How should I modify my code? Thanks.
Hi,
you can refer to can_pal demo example. a below code is used to start receiving message
/* Define receive buffer */
can_message_t recvMsg;
/* Start receiving data in RX_MAILBOX. */
CAN_Receive(&can_pal1_instance, RX_MAILBOX, &recvMsg);
So MB used and address of receive buffer (recvMsg) are specified. After message is received you can access buffer using recvMsg.data[n]
/* Wait until the previous FlexCAN receive is completed */
while(CAN_GetTransferStatus(&can_pal1_instance, RX_MAILBOX) == STATUS_BUSY);
/* Check the received message payload */
if((recvMsg.data[0] == LED0_CHANGE_REQUESTED)
BR, Petr