keil_examples/CANACT/can.c
/*****************************************************************************
** Function name:		CAN_Handler
**
** Descriptions:		CAN interrupt handler
**
** parameters:			None
** Returned value:		None
** 
*****************************************************************************/
Function name:         CAN_Handler
Descriptions:          CAN interrupt handler

None
Returned value:                None
Function name : CAN_Handler Descriptions : CAN interrupt handler None Returned value : None
void CAN_IRQHandler(void)  
{		
  CANStatus = LPC_CANCR->RxSR;
  if ( CANStatus & (1 << 8) )
  {
	CAN1RxCount++;
	CAN_ISR_Rx1();
  }
  if ( CANStatus & (1 << 9) )
  {
	CAN2RxCount++;
	CAN_ISR_Rx2();
  }
  if ( LPC_CAN1->GSR & (1 << 6 ) )
  {
	CAN1ErrCount = LPC_CAN1->GSR >> 16;
  }
  if ( LPC_CAN2->GSR & (1 << 6 ) )
  {
	CAN2ErrCount = LPC_CAN2->GSR >> 16;
  }
  return;
}
void CAN_IRQHandler ( void ) { CANStatus = LPC_CANCR -> RxSR ; if ( CANStatus & ( 1 << 8 ) ) { CAN1RxCount ++ ; CAN_ISR_Rx1 ( ) ; } if ( CANStatus & ( 1 << 9 ) ) { CAN2RxCount ++ ; CAN_ISR_Rx2 ( ) ; } if ( LPC_CAN1 -> GSR & ( 1 << 6 ) ) { CAN1ErrCount = LPC_CAN1 -> GSR >> 16 ; } if ( LPC_CAN2 -> GSR & ( 1 << 6 ) ) { CAN2ErrCount = LPC_CAN2 -> GSR >> 16 ; } return ; }
Function name:         CAN_Handler
Descriptions:          CAN interrupt handler
Function name : CAN_Handler Descriptions : CAN interrupt handler
/* The error count includes both TX and RX */ /* The error count includes both TX and RX */