This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: CAN bus error checking

Part Number: TMS320F28379D

Tool/software:

I am looking into CAN bus error handling and I am wondering what the reason is for using the following when checking for CAN bus errors?

if(((status & ~(CAN_STATUS_TXOK | CAN_STATUS_RXOK)) != 7) &&
((status & ~(CAN_STATUS_TXOK | CAN_STATUS_RXOK)) != 0))

instead of

if(((status & CAN_STATUS_LEC_MSK) != CAN_STATUS_LEC_MSK) &&
((status & CAN_STATUS_LEC_MSK) != CAN_STATUS_LEC_NONE))

It seems that it is assumed that the other error bits are not considered in the check.  Are bits 5-8 not used?