Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 9 months ago.
Handling F746 UART Rx Interrupts
How do I disable/enable UART receive interrupts in a F746NG? In the ISR example below for the K64F (LPC1768 version commented out) I do the following:
1. Disable the UART interrupt
2. Process RX characters
3. Enable the UART interrupt again
4. Exit ISR
void PcRxIRQ(void) { NVIC_DisableIRQ(UART0_RX_TX_IRQn); //n=0, 1 or 2 Disable Rx interrupt on k64f //LPC_UART0->IER = 0; //Disable Rx interrupt on mbed1768 while (pc.readable()) { inchar = pc.getc(); //get a character PcRxChar(inchar); //go process char } NVIC_EnableIRQ(UART0_RX_TX_IRQn); //n=0, 1 or 2 Re-enable Rx interrupt on k64f //LPC_UART0->IER = 1; //RE-enable Rx interrupt on mbed1768 }
Question relating to:
1 Answer
8 years, 9 months ago.
There is no reason why you would need to disable the interrupt while processing the current interrupt. It simply is not capable of interrupting its own interrupt handler.