/* Returns n number of characters from the ring buffer or until empty.  */
uint32_t am_hal_uart_char_receive_buffered(uint32_t ui32Module, char *pcString, uint32_t ui32MaxChars)
/* Returns n number of characters from the ring buffer or until empty.  */
uint32_t am_hal_uart_char_receive_buffered(uint32_t ui32Module, char *pcString, uint32_t ui32MaxChars)
{
    uint32_t ui32NumChars = 0;
    while (am_hal_queue_data_left(&g_psRxQueue[ui32Module]) && ui32MaxChars)
    {
        am_hal_queue_item_get(&g_psRxQueue[ui32Module], pcString, 1);
        ui32MaxChars--;
        ui32NumChars++;
        pcString++;
    }
    return ui32NumChars;
}