What exactly does rderror and tderror tell you? I assume that rderror reports TRUE if there was a buffer overflow and messages were missed? I could not find any sample code for rderror and tderror on the forum or website. Can someone post some examples?
Here is how I'm using rderror. Is this correct?
Edited code after original post:
CAN1ReadError = FALSE;
if(can1.rderror() == TRUE)
{
pc.printf("CAN1 Read Error. Buffer overflow.\r\n");
}
MessageFoundCAN1 = FALSE;
if ( can1.read(CAN1_MsgRx) ) // See if any CAN messages are in CAN1 Buffer- MSCAN
{
MessageFoundCAN1 = TRUE;
led1 = !led1; // Toggle LED1
MessagesFound = MessagesFound + 1;
}
What exactly does rderror and tderror tell you? I assume that rderror reports TRUE if there was a buffer overflow and messages were missed? I could not find any sample code for rderror and tderror on the forum or website. Can someone post some examples?
Here is how I'm using rderror. Is this correct?
Edited code after original post: