What is the proper way to clear the interrupt bits for the ENET_ISR?
Below is some code snippets. Is this the correct way to handle clearing the interrupt? Is there a better way? Is there something else I should do? I enable the following interrupts:
The method looks correct - simply write the bit to be cleared with 1. However I see no advantage in collecting the serviced interrupt bits and clearing them all at the end of the routine. Rather than doing irqToClear |= 0x00000020; you could simply do ENET_DMA->ISR = 0x00000020; Also it may be an idea to use a loop in the routine so that it only exits when all interrupt have been service (an interrupt can arrive while in the IRQ so it can be serviced without having to first quit. Eg: while ((ENET_ISR) & ENET_IER) { // while enabled interrupts waiting, handle them all if (ENET_ISR & TX_CURR_DONE_EN) { ENET_ISR = TX_CURR_DONE_EN; // reset flag // etc. } if (ENET_ISR & RX_ENTRY_EN) { ENET_ISR = RX_ENTRY_EN; // reset flag // etc. } // etc.... } Regards Mark