#include #include #include #include ssize_t _bsp_read(int fd, void *ptr, size_t len) { uint8_t *current = (uint8_t *)ptr; volatile uint32_t *uart_rx = (uint32_t *)0xFFFF0000; ssize_t result = 0; if (isatty(fd)) { for (current = (uint8_t *)ptr; (current < ((uint8_t *)ptr) + len); current++) { *current = *uart_rx; result++; } return result; } return EOF; }