XilinxProcessorIPLib/drivers/can/examples/xcan_intr_example.c
static void RecvHandler(void *CallBackRef)
{
	XCan *CanPtr = (XCan *)CallBackRef;
	int Status;
	int Index;
	u8 *FramePtr;

	Status = XCan_Recv(CanPtr, RxFrame);
	if (Status != XST_SUCCESS) {
		LoopbackError = TRUE;
		RecvDone = TRUE;
		return;
	}

	/*
	 * Verify Identifier and Data Length Code.
	 */
	if (RxFrame[0] != XCan_CreateIdValue(TEST_MESSAGE_ID, 0, 0, 0, 0)) {
		LoopbackError = TRUE;
		RecvDone = TRUE;
		return;
	}

	if (RxFrame[1] != XCan_CreateDlcValue(FRAME_DATA_LENGTH)) {
		LoopbackError = TRUE;
		RecvDone = TRUE;
		return;
	}

	/*
	* Verify Data field contents.
	*/
	FramePtr = (u8 *)(&RxFrame[2]);
	for (Index = 0; Index < FRAME_DATA_LENGTH; Index++){
		if (*FramePtr++ != (u8)Index) {
			LoopbackError = TRUE;
			break;
		}
	}

	RecvDone = TRUE;
}
/*****************************************************************************/
/**
*
* Callback function (called from interrupt handler) to handle frames received in
* interrupt mode.  This function is called once per frame received.
* The driver's receive function is called to read the frame from RX FIFO.
*
* @param	CallBackRef is the callback reference passed from the interrupt
*		handler, which in our case is a pointer to the device instance.
*
* @return	None.
*
* @note		This function is called by the driver within interrupt context.
*
******************************************************************************/
Callback function (called from interrupt handler) to handle frames received in
interrupt mode.  This function is called once per frame received.
The driver's receive function is called to read the frame from RX FIFO.
Callback function ( called from interrupt handler ) to handle frames received in interrupt mode . This function is called once per frame received . The driver ' s receive function is called to read the frame from RX FIFO .
static void RecvHandler(void *CallBackRef)
{
	XCan *CanPtr = (XCan *)CallBackRef;
	int Status;
	int Index;
	u8 *FramePtr;
	Status = XCan_Recv(CanPtr, RxFrame);
	if (Status != XST_SUCCESS) {
		LoopbackError = TRUE;
		RecvDone = TRUE;
		return;
	}
	if (RxFrame[0] != XCan_CreateIdValue(TEST_MESSAGE_ID, 0, 0, 0, 0)) {
		LoopbackError = TRUE;
		RecvDone = TRUE;
		return;
	}
	if (RxFrame[1] != XCan_CreateDlcValue(FRAME_DATA_LENGTH)) {
		LoopbackError = TRUE;
		RecvDone = TRUE;
		return;
	}
	FramePtr = (u8 *)(&RxFrame[2]);
	for (Index = 0; Index < FRAME_DATA_LENGTH; Index++){
		if (*FramePtr++ != (u8)Index) {
			LoopbackError = TRUE;
			break;
		}
	}
	RecvDone = TRUE;
}
static void RecvHandler ( void * CallBackRef ) { XCan * CanPtr = ( XCan * ) CallBackRef ; int Status ; int Index ; u8 * FramePtr ; Status = XCan_Recv ( CanPtr , RxFrame ) ; if ( Status != XST_SUCCESS ) { LoopbackError = TRUE ; RecvDone = TRUE ; return ; } if ( RxFrame [ 0 ] != XCan_CreateIdValue ( TEST_MESSAGE_ID , 0 , 0 , 0 , 0 ) ) { LoopbackError = TRUE ; RecvDone = TRUE ; return ; } if ( RxFrame [ 1 ] != XCan_CreateDlcValue ( FRAME_DATA_LENGTH ) ) { LoopbackError = TRUE ; RecvDone = TRUE ; return ; } FramePtr = ( u8 * ) ( & RxFrame [ 2 ] ) ; for ( Index = 0 ; Index < FRAME_DATA_LENGTH ; Index ++ ) { if ( * FramePtr ++ != ( u8 ) Index ) { LoopbackError = TRUE ; break ; } } RecvDone = TRUE ; }
Callback function (called from interrupt handler) to handle frames received in
interrupt mode.
Callback function ( called from interrupt handler ) to handle frames received in interrupt mode .
/*
	 * Verify Identifier and Data Length Code.
	 */ /*
	* Verify Data field contents.
	*/