OpenCores
URL https://opencores.org/ocsvn/ion/ion/trunk

Subversion Repositories ion

[/] [ion/] [trunk/] [src/] [common/] [libsoc/] [src/] [hw_ion_mpu.c] - Diff between revs 172 and 229

Show entire file | Details | Blame | View Log

Rev 172 Rev 229
Line 25... Line 25...
}
}
 
 
/** Replacement for the standard C library getchar. */
/** Replacement for the standard C library getchar. */
int getchar(void){
int getchar(void){
    uint32_t uart;
    uint32_t uart;
 
    uint8_t c;
 
 
    while(1){
    while(1){
        uart = *((volatile uint32_t *)UART_STATUS);
        uart = *((volatile uint32_t *)UART_STATUS);
        if(uart & UART_RXRDY_MASK) break;
        if(uart & UART_RXRDY_MASK) break;
    }
    }
    uart = *((volatile uint32_t *)UART_RX);
    c = *((volatile uint8_t *)UART_RX);
    uart = (uart >> 24) & 0x0ff;
    return (int)c;
    return (int)uart;
 
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.