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 +++++++++++++++++++++++++++++++++++++++++++++++ src/inc/uart/uart.h | 17 +++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100755 src/inc/uart/uart.c create mode 100755 src/inc/uart/uart.h (limited to 'src/inc/uart') 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< + #include + + /// #define STRING_SIZE 32 + /// typedef struct + /// { + /// char data[STRING_SIZE]; + /// int8_t size; + /// } string; + /// volatile string uart_string; + + void uart_init(); + void uart_putc(char c); + +#endif -- cgit v1.2.3