/* USART IRQ handler. 
Interrupt handler for USART. After reception is done, set g_ul_recv_done to true, and if transmission is done, set g_ul_sent_done to true.  */
void USART_Handler(void)
/* USART IRQ handler. 
Interrupt handler for USART. After reception is done, set g_ul_recv_done to true, and if transmission is done, set g_ul_sent_done to true.  */
void USART_Handler(void)
{
	uint32_t ul_status;
	ul_status = usart_get_status(BOARD_USART);
	if ((ul_status & US_CSR_RXBUFF) && (g_uc_state == STATE_READ)) {
		g_ul_recv_done = true;
		usart_disable_interrupt(BOARD_USART, US_IDR_RXBUFF);
	}
	if ((ul_status & US_CSR_TXBUFE) && (g_uc_state == STATE_WRITE)) {
		g_ul_sent_done = true;
		usart_disable_interrupt(BOARD_USART, US_IDR_TXBUFE);
	}
}