if( ubTempVarObjHandler & MOSTAT_RXPND) // if RXPND is set { if( ubTempVarObjHandler & MOSTAT_NEWDAT) // if NEWDAT is set { if( ubTempVarObjHandler & MOSTAT_MSGLST) // if MSGLST is set { // Indicates that the CAN controller has stored a new message into this object, // while NEWDAT was still set, ie. the previously stored message is lost. } else { // The CAN controller has stored a new message into this object. CAN_vWriteCANAddress(CAN_MODATAL(ubTempMsgID)); // Add this line CAN_vReadEN(); // Add this line IO_vWritePort(P3, CAN_DATA0); // Add this line } } // Reset RXPND, NEWDAT, MSGLST (if set) CAN_vWriteCANAddress(CAN_MOCTR(ubTempMsgID)); // Addressing CAN_MOCTRn CAN_DATA0 = (ubTempVarObjHandler & MOSTAT_RST_MNR); // load CAN Data Register 0 CAN_DATA1 = 0x00; // load CAN Data Register 1 CAN_DATA2 = 0x00; // load CAN Data Register 2 CAN_DATA3 = 0x00; // load CAN Data Register 3 CAN_vWriteEN(ALL_DATA_VALID); // Writemode is Enabled } // End of RXPNDn