diff options
| author | hathach <[email protected]> | 2019-03-20 20:58:27 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-03-20 20:58:27 +0700 |
| commit | 20fb416783c4dcce71a581f6db1674a3c6a1ae12 (patch) | |
| tree | a4e36f39293a40193c88e7c18dedd73ebc0e9f50 /hw/bsp/printf_retarget.c | |
| parent | da55610f4355bb65bd9297798f9ad961807feea9 (diff) | |
clean board uart read & write
Diffstat (limited to 'hw/bsp/printf_retarget.c')
| -rw-r--r-- | hw/bsp/printf_retarget.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/bsp/printf_retarget.c b/hw/bsp/printf_retarget.c index 34f68fbb0..0c1d80d17 100644 --- a/hw/bsp/printf_retarget.c +++ b/hw/bsp/printf_retarget.c @@ -168,8 +168,8 @@ size_t __read(int handle, unsigned char *buf, size_t bufSize) size_t i; for (i=0; i<bufSize; i++) { - uint8_t ch = board_uart_getchar(); - if (ch == 0) break; + int8_t ch = board_uart_getchar(); + if (ch == -1) break; buf[i] = ch; } |
