static ssize_t uart_stdio_vfs_write(vfs_file_t *filp, const void *src, size_t nbytes) { int fd = filp->private_data.value; if (fd == STDIN_FILENO) { return -EBADF; } return uart_stdio_write(src, nbytes); }
/** * @brief Write one character to the STDIO UART interface - used by e.g. * printf and puts */ int putchar(int c) { char _c = c; uart_stdio_write(&_c, 1); return 1; }
/** * @brief Write characters to a file * * All output is currently directed to UART_0, independent of the given file descriptor. * The write call will further block until the byte is actually written to the UART. * * TODO: implement more sophisticated write call. * * @param r TODO * @param fd TODO * @param data TODO * @param int TODO * * @return TODO */ int _write_r(struct _reent *r, int fd, const void *data, unsigned int count) { (void) r; (void) fd; return uart_stdio_write(data, count); }
static int _uart_putchar(char c, FILE *stream) { (void) stream; uart_stdio_write(&c, 1); return 0; }