/* DMA receive done process. This need add to DMA receive done ISR. */
static void dma_rx_done_isr(struct rt_serial_device *serial)
/* DMA receive done process. This need add to DMA receive done ISR. */
static void dma_rx_done_isr(struct rt_serial_device *serial)
{
    struct n32_uart *uart = (struct n32_uart *) serial->parent.user_data;
    rt_size_t recv_len;
    rt_base_t level;
    level = rt_hw_interrupt_disable();
    recv_len = uart->dma.setting_recv_len - uart->dma.last_recv_index;
    uart->dma.last_recv_index = 0;
    rt_hw_interrupt_enable(level);
    if (recv_len)
        rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_DMADONE | (recv_len << 8));
    DMA_ClearFlag(uart->dma.rx_gl_flag, uart->dma.rx_dma_type);
}