From 2df2697107d7873232c31a25a6947711b0903edb Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 27 Jul 2015 15:12:22 +0200 Subject: latest running version from march 2011, not having been in repo before, dcf77 working, mp3 playback and two display types are supported --- src/inc/uart/uart.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 src/inc/uart/uart.c (limited to 'src/inc/uart/uart.c') diff --git a/src/inc/uart/uart.c b/src/inc/uart/uart.c new file mode 100755 index 0000000..b2f1a59 --- /dev/null +++ b/src/inc/uart/uart.c @@ -0,0 +1,47 @@ +#include "uart.h" + +/// // UART-Receiver... +/// ISR(USART_RXC_vect) +/// { + /// unsigned char buffer; + /// buffer = UDR; + /// if(uart_string.size == -1) return; + /// if(buffer == '\n') + /// { + /// uart_string.data[uart_string.size] = '\0'; + /// uart_string.size = -1; + /// } + /// else + /// { + /// uart_string.data[uart_string.size] = buffer; + /// if(++uart_string.size > STRING_SIZE) + /// { uart_string.size = 0; } + /// } +/// } + +void uart_init() +{ + /// uart_string.size = 0; + /// uart_string.data[0] = '\0'; + + // activate UART TX // and RX... + UCSRB |= (1<