summaryrefslogtreecommitdiff
path: root/uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'uart.c')
-rw-r--r--uart.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/uart.c b/uart.c
index b6271c1..29f6df4 100644
--- a/uart.c
+++ b/uart.c
@@ -52,17 +52,21 @@ uartputc(int c)
int
uartgetc(void)
{
- if(*(5) & 0x01){
+ if(*R(5) & 0x01){
// input data is ready.
return *R(0);
} else {
return -1;
- };
+ }
}
void
uartintr(void)
{
- int c = uartgetc();
- printf("%x ", c & 0xff);
+ while(1){
+ int c = uartgetc();
+ if(c == -1)
+ break;
+ consoleintr(c);
+ }
}