summaryrefslogtreecommitdiff
path: root/uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'uart.c')
-rw-r--r--uart.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/uart.c b/uart.c
index 659c574..b6271c1 100644
--- a/uart.c
+++ b/uart.c
@@ -49,11 +49,15 @@ uartputc(int c)
*R(0) = c;
}
-uint
+int
uartgetc(void)
{
- // XXX this isn't right, must check there's data in the FIFO.
- return *R(0);
+ if(*(5) & 0x01){
+ // input data is ready.
+ return *R(0);
+ } else {
+ return -1;
+ };
}
void