/* Receives an amount of data in non blocking mode.  */
static ald_status_t __uart_recv_by_it(ald_uart_handle_t *hperh)
/* Receives an amount of data in non blocking mode.  */
static ald_status_t __uart_recv_by_it(ald_uart_handle_t *hperh)
{
    if ((hperh->state & ALD_UART_STATE_RX_MASK) == 0x0)
        return ALD_BUSY;
    *hperh->rx_buf++ = (uint8_t)(hperh->perh->RXBUF & 0xFF);
    hperh->rx_count++;
    if (hperh->rx_count >= hperh->rx_size)
    {
        ald_uart_interrupt_config(hperh, ALD_UART_IT_RFNEMPTY, DISABLE);
        CLEAR_BIT(hperh->state, ALD_UART_STATE_RX_MASK);
        if (hperh->rx_cplt_cbk)
            hperh->rx_cplt_cbk(hperh);
    }
    return ALD_OK;
}