Example #1
0
void RealView_putc(int c)
{
    if(!gRealviewUartBase)
        return;
    
    while(AMBA_UART_FR(gRealviewUartBase) & (1 << 5))
        barrier();
    
    AMBA_UART_DR(gRealviewUartBase) = c;
}
Example #2
0
int RealView_getc(void)
{
    unsigned char c;
    if (!gRealviewUartBase)
        return -1;

    int i = 0x80000;
    while (AMBA_UART_FR(gRealviewUartBase) & (1 << 4)) {
        i--; if(!i) return -1;
    }

    c = AMBA_UART_DR(gRealviewUartBase);
    return c;
}