diff options
author | root <root@no.no.james.local> | 2014-12-08 18:39:07 +0000 |
---|---|---|
committer | root <root@no.no.james.local> | 2014-12-08 18:39:07 +0000 |
commit | 804820fe687affa38a52e302179e4a2293cb1ffb (patch) | |
tree | acb784fd60af24d8c389e366d74409c75802dfa0 /stdio.c | |
download | rgb_ring-804820fe687affa38a52e302179e4a2293cb1ffb.tar.gz rgb_ring-804820fe687affa38a52e302179e4a2293cb1ffb.tar.bz2 rgb_ring-804820fe687affa38a52e302179e4a2293cb1ffb.zip |
fish
Diffstat (limited to 'stdio.c')
-rw-r--r-- | stdio.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +#include "project.h" + +static int +stdio_uart_putchar (char var, FILE * stream) +{ + + if (var == '\n') + uart_putc ('\r'); + uart_putc (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; + + uart_init (UART_BAUD_SELECT (UART_BAUD_RATE, F_CPU)); + sei (); +} |