提交 3adc4154 创建 作者: Austin Clements's avatar Austin Clements

Hack to make newlines on the serial port work

上级 67f7909f
...@@ -205,6 +205,9 @@ consoleintr(int (*getc)(void)) ...@@ -205,6 +205,9 @@ consoleintr(int (*getc)(void))
break; break;
default: default:
if(c != 0 && input.e-input.r < INPUT_BUF){ 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; input.buf[input.e++ % INPUT_BUF] = c;
consputc(c); consputc(c);
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论