2018-01-29 01:50:22 +01:00
|
|
|
#include "uart.h"
|
|
|
|
#include <avr/io.h>
|
|
|
|
|
|
|
|
#define BAUD_PRESCALE (((F_CPU/(BAUDRATE*8UL)))-1)
|
|
|
|
|
|
|
|
void __attribute__ ((naked)) __attribute__ ((section (".init5"))) uart_init() {
|
2018-04-05 00:35:09 +02:00
|
|
|
UCSRA = (1<<U2X);
|
|
|
|
UCSRC = (1<<UCSZ0) | (1<<UCSZ1); // 8N1
|
|
|
|
UBRRH = (BAUD_PRESCALE>>8);
|
|
|
|
UBRRL = BAUD_PRESCALE;
|
2018-01-29 01:50:22 +01:00
|
|
|
}
|