Uart: add receive
This commit is contained in:
parent
1fcf63409c
commit
694257c5ac
7
uart.c
7
uart.c
@ -36,6 +36,13 @@ void uart_init(void )
|
||||
UART0_CR = 0x301; //Active Tx, Rx & FIFO
|
||||
}
|
||||
|
||||
char uart_recv(void)
|
||||
{
|
||||
while (UART0_FR & (1 << 4)) {
|
||||
}
|
||||
return UART0_DR & 0xFF;
|
||||
}
|
||||
|
||||
void putc(char c){
|
||||
//FIFO Full?
|
||||
while(UART0_FR & (1<<5)){}
|
||||
|
Loading…
Reference in New Issue
Block a user