Hi,
Thanks for the Reply.
Currently the code is for Rx is like below.
while(1)
{
CAN_Receive(INST_CAN_PAL1, RX_MAILBOX, &recvMsg);
/* Wait until the previous FlexCAN receive is completed */
while(CAN_GetTransferStatus(INST_CAN_PAL1, RX_MAILBOX) == STATUS_BUSY);//If no message received it's blocking on Here
/* Check the received message ID and payload */
if((recvMsg.data[0] == LED0_CHANGE_REQUESTED) &&
recvMsg.id == RX_MSG_ID)
{
/* Toggle output value LED1 */
PINS_DRV_TogglePins(GPIO_PORT, (1 << LED0));
}
}
If i removed the while condition, The LED Toggling is not working
also if i changed the code like below also the Toggling is not working.
CAN_Receive(INST_CAN_PAL1, RX_MAILBOX, &recvMsg);
if(CAN_GetTransferStatus(INST_CAN_PAL1, RX_MAILBOX) != STATUS_BUSY)
{
// read data from receive buffer
CAN_Receive(INST_CAN_PAL1, RX_MAILBOX, &recvMsg);
}