#include "platform.h" #include #include #include #include ssize_t _bsp_read(int fd, void *ptr, size_t len) { uint8_t *current = (uint8_t *)ptr; ssize_t result = 0; if (isatty(fd)) { for (current = (uint8_t *)ptr; (current < ((uint8_t *)ptr) + len) && (get_uart_rx_tx_reg_rx_avail(uart) > 0); current++) { *current = uart_read(uart); result++; } return result; } return EOF; }