提交 8bdf86f7 编写于 作者: Z Zihao Yu

test,uart: return -1 when no input

上级 7d358b24
......@@ -31,7 +31,7 @@ extern "C" void uart_getc(uint8_t *ch) {
static uint32_t lasttime = 0;
uint32_t now = uptime();
*ch = 0;
*ch = -1;
if (now - lasttime > 30000) {
lasttime = now;
*ch = uart_dequeue();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册