Browse Source

Fix sbi_console_getchar return value if no UART is present

The UART drivers all return -1 if no character is present, and so that's
what we should do if there's no UART at all.

See discussion on https://github.com/riscv-non-isa/riscv-sbi-doc/issues/82
pull/276/head
Andrew Waterman 4 years ago
parent
commit
0d3339c73e
  1. 2
      machine/mtrap.c

2
machine/mtrap.c

@ -77,7 +77,7 @@ static uintptr_t mcall_console_getchar()
} else if (htif) {
return htif_console_getchar();
} else {
return '\0';
return (uintptr_t)-1;
}
}

Loading…
Cancel
Save