aboutsummaryrefslogtreecommitdiff
path: root/kernel/uart.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2011-07-06 07:06:38 +0000
committerDimitri Sokolyuk <demon@dim13.org>2011-07-06 07:06:38 +0000
commit8d7b858476f143907cc95d0c1a3a7bbb1b5776d3 (patch)
tree4e3e6dc9a3eec6a49dfe7e80a594b6e328dde9a9 /kernel/uart.c
parent2d9f55951dfa61457a1858ea462dcb8ccdb472b8 (diff)
prepare uart for stdio
Diffstat (limited to 'kernel/uart.c')
-rw-r--r--kernel/uart.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/uart.c b/kernel/uart.c
index 9163e0b..a952758 100644
--- a/kernel/uart.c
+++ b/kernel/uart.c
@@ -21,6 +21,7 @@
#endif
#include <inttypes.h>
+#include <stdio.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
@@ -28,14 +29,18 @@
#include "kernel.h"
#include "tasks.h"
-void
+int
uart_putchar(char c)
{
+ if (c == '\n')
+ uart_putchar('\r');
loop_until_bit_is_set(UCSRA, UDRE);
UDR = c;
+
+ return 0;
}
-char
+int
uart_getchar(void)
{
char c;