Content originally posted in LPCWare by Ex-Zero on Thu Feb 16 03:30:16 MST 2012
I'm not sure what you are trying to do :eek:
What's that?
Quote:
if ( (LPC_CAN2->ICR) [B][COLOR=Red]&&[/COLOR][/B] ([B][COLOR=DarkOrange]0x08[/COLOR][/B])) // IDIE
Are you trying to read DOI or IDI?
Quote:
if (LPC_CAN2->ICR & (1<<8)) //read IDI
User manual:
Quote:
16.7.4 CAN Interrupt and Capture Register (CAN1ICR - 0x4004 400C, CAN2ICR - 0x4004 800C)
Bits in this register indicate information about events on the CAN bus. This register is
read-only.
The Interrupt flags of the Interrupt and Capture Register allow the identification of an
interrupt source. When one or more bits are set, a CAN interrupt will be indicated to the
CPU. [COLOR=Red]After this register is read from the CPU all interrupt bits are reset[/COLOR] except of the
Receive Interrupt bit. The Interrupt Register appears to the CPU as a read-only memory.
Bits 1 through 10 clear when they are read.