5746R CAN SDK data trans to array

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

5746R CAN SDK data trans to array

581件の閲覧回数
supra0309
Contributor I

Hi guys, I'm using 5746R to receive CAN SDK data, here's the struct from can_pal.h file. 

supra0309_0-1618972634742.png

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.

supra0309_5-1618973283439.png

supra0309_2-1618973064098.png

supra0309_3-1618973102672.png

 

 

 

 

0 件の賞賛
返信
1 返信

574件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

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

0 件の賞賛
返信