pl011 uart: Complete function to get a character

This commit is contained in:
Alexander von Gluck IV
2012-05-16 06:01:51 -05:00
parent ce077d96cb
commit 4747ee6ea8
+9 -1
View File
@@ -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;
} }