avr-firmwares/drivers/uart_rx_async.c

18 lines
353 B
C
Raw Normal View History

#include "uart_rx_async.h"
#include "uart.h"
#include <avr/io.h>
#include <avr/interrupt.h>
void __attribute__ ((naked)) __attribute__ ((section (".init6"))) uart_rx_init() {
2018-04-05 00:35:09 +02:00
UCSRB |= (1<<RXEN) | (1<<RXCIE);
}
void __attribute__ ((naked)) __attribute__ ((section (".init8"))) uart_rx_sei() {
sei();
}
ISR(USART_RX_vect) {
2018-04-05 00:35:09 +02:00
uart_process(UDR);
}