Tool/software: TI-RTOS
Hi:
I want to know how to use the DCAN driver without the callback interrupt.
I tried to write something like polling, but I may not do it right, here is the part of my code:
CAN_DCANData appDcanRxData; for(CanPduId=0;CanPduId<CAN_Rx_NUM;CanPduId++){ retVal = CAN_getData(canRxMsgObjHandle[CanPduId], &appDcanRxData, &errCode); if(retVal == 0 && appDcanRxData.dataLength > 0){ /*do something*/ } }
The code iterates the Rx message handles, if there are data in that handle, then do something.
The problem is the data is not cleared after it receives in that Rx message handle. It treats like a new data coming, even though there are no new data puts into the CAN bus.