diff -r 000000000000 -r 9b7de464f0ea blackbox/driver/rs232.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blackbox/driver/rs232.c Mon Nov 14 20:31:32 2011 +0100 @@ -0,0 +1,64 @@ +#include +#include +#include +#include +#include +#include "../main.h" +#include "rs232.h" + +void RS232_init(void) { + // first init UART + // set baud rate + UBRRH = UBRRH_VALUE; + UBRRL = UBRRL_VALUE; + #if USE_2X + UCSRA |= (1 << U2X); + #else + UCSRA &= ~(1 << U2X); + #endif + // enable receiver and transmitter and Rx interrupts + UCSRB = (1<