diff options
Diffstat (limited to 'stdio.c')
-rw-r--r-- | stdio.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ +#include "project.h" + +static int +stdio_uart_putchar (char var, FILE * stream) +{ + if (var == '\n') + usb_serial_putchar_nowait ('\r'); + usb_serial_putchar_nowait (var); + return 0; +} + + +static FILE stdio_uart_stdout = +FDEV_SETUP_STREAM (stdio_uart_putchar, NULL, _FDEV_SETUP_WRITE); + +void +stdio_init (void) +{ + stdout = &stdio_uart_stdout; + usb_init(); +// while (!usb_configured()) /* wait */ ; + usb_serial_flush_input(); +} |