diff options
Diffstat (limited to 'uart.c')
-rw-r--r-- | uart.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 |