summaryrefslogtreecommitdiff
path: root/stmhal/pybstdio.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-31 13:47:06 +0000
committerDamien George <damien.p.george@gmail.com>2014-07-31 13:47:06 +0000
commit8cc2018d47bc15a1b10295965fc0ccd27c0dcbba (patch)
tree5e8ba4bed5de1f1973203b9cff2c8aab78b419fc /stmhal/pybstdio.c
parentc9aa58e6381018cca2513e3468363af0b5442d1f (diff)
parentbb4c6f35c627ab3487cdd6bafb4588cc633cd6a4 (diff)
Merge branch 'master' of https://github.com/micropython/micropython
Diffstat (limited to 'stmhal/pybstdio.c')
-rw-r--r--stmhal/pybstdio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/stmhal/pybstdio.c b/stmhal/pybstdio.c
index 88f47d1b4..2121a6cbb 100644
--- a/stmhal/pybstdio.c
+++ b/stmhal/pybstdio.c
@@ -84,8 +84,10 @@ int stdin_rx_chr(void) {
}
#endif
#endif
- if (usb_vcp_rx_num() != 0) {
- return usb_vcp_rx_get();
+
+ byte c;
+ if (usb_vcp_recv_byte(&c) != 0) {
+ return c;
} else if (pyb_stdio_uart != PYB_UART_NONE && uart_rx_any(pyb_stdio_uart)) {
return uart_rx_char(pyb_stdio_uart);
}