pl011 uart: Complete function to get a character
This commit is contained in:
@@ -152,7 +152,15 @@ UartPL011::PutChar(char c)
|
|||||||
int
|
int
|
||||||
UartPL011::GetChar(bool wait)
|
UartPL011::GetChar(bool wait)
|
||||||
{
|
{
|
||||||
#warning ARM Amba PL011 UART incomplete
|
if (fUARTEnabled == true) {
|
||||||
|
// Wait until a character is received?
|
||||||
|
if (wait) {
|
||||||
|
while ((ReadUart(PL01x_FR) & PL01x_FR_RXFE) != 0)
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
|
return ReadUart(PL01x_DR);
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user