/* Receives a character from the specified port. 
This function replaces the original UARTCharNonBlockingGet() API and performs the same actions. A macro is provided in  */
unsigned long UARTCharGetNonBlocking(unsigned long ulBase)
/* Receives a character from the specified port. 
This function replaces the original UARTCharNonBlockingGet() API and performs the same actions. A macro is provided in  */
unsigned long UARTCharGetNonBlocking(unsigned long ulBase)
{
    xtBoolean     ulStatus = xfalse;
    unsigned long ulChar   = 0;
    xASSERT((ulBase == UART0_BASE) || (ulBase == UART1_BASE) ||
            (ulBase == UART2_BASE) );
    ulStatus = (xtBoolean) (xHWREGB(ulBase + UART_012_S1) &
                           (unsigned char)(UART_012_S1_RDRF_MASK));
    if(xtrue == ulStatus)
    {
        ulChar = (unsigned long) xHWREGB(ulBase + UART_012_D);
    }
    else
    {
        ulChar = (unsigned long) (-1);
    }
    return (ulChar);
}