CODE UART Interrupt handler

Table 1. CODE UART Code example
Interrupt handler
void Usart_IRQHandler() {
	uint32_t intstat = LPC_USART->INTSTAT;
	if(intstat & UART_STAT_RXRDY) {
		if(!tx_rdy_flag) abort();
		tx_rdy_flag = 0;
		LPC_USART->TXDAT = LPC_USART->RXDAT;
		LPC_USART->INTENSET = UART_STAT_TXRDY;
		tx_counter++;
	}
	if(intstat & UART_STAT_TXRDY) {
		if(tx_rdy_flag) abort();
		tx_rdy_flag = 1;
		LPC_USART->INTENCLR = UART_STAT_TXRDY;
	}
}

-->