]> Devi Nivas Git - cs3210-lab1.git/commitdiff
Hack to make newlines on the serial port work
authorAustin Clements <amdragon@mit.edu>
Mon, 21 Sep 2009 03:09:59 +0000 (23:09 -0400)
committerAustin Clements <amdragon@mit.edu>
Mon, 21 Sep 2009 03:09:59 +0000 (23:09 -0400)
console.c

index 0613a471d7abb5acc61f71ad4e7509ead44b4ad1..f7a6590b653edade1fa8669df9a50b31be81255c 100644 (file)
--- a/console.c
+++ b/console.c
@@ -205,6 +205,9 @@ consoleintr(int (*getc)(void))
       break;
     default:
       if(c != 0 && input.e-input.r < INPUT_BUF){
+        // The serial port produces 0x13, not 0x10
+        if(c == '\r')
+          c = '\n';
         input.buf[input.e++ % INPUT_BUF] = c;
         consputc(c);
         if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){