diff options
Diffstat (limited to 'hw/bsp/board.h')
| -rw-r--r-- | hw/bsp/board.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/hw/bsp/board.h b/hw/bsp/board.h index 339e2e3b5..036556731 100644 --- a/hw/bsp/board.h +++ b/hw/bsp/board.h @@ -1,4 +1,4 @@ -/* +/* * The MIT License (MIT) * * Copyright (c) 2019 Ha Thach (tinyusb.org) @@ -66,9 +66,11 @@ void board_led_write(bool state); uint32_t board_button_read(void); // Get characters from UART +// Return number of read bytes int board_uart_read(uint8_t* buf, int len); // Send characters to UART +// Return number of sent bytes int board_uart_write(void const * buf, int len); #if CFG_TUSB_OS == OPT_OS_NONE @@ -130,16 +132,8 @@ static inline void board_delay(uint32_t ms) } } -static inline int board_uart_getchar(void) -{ - uint8_t c; - return board_uart_read(&c, 1) ? (int) c : (-1); -} - -static inline int board_uart_putchar(uint8_t c) -{ - return board_uart_write(&c, 1); -} +// stdio getchar() is blocking, this is non-blocking version +int board_getchar(void); #ifdef __cplusplus } |
