avr-firmwares/drivers/uart_tx.c
2018-04-04 22:35:09 +00:00

14 lines
299 B
C

#include "uart_tx.h"
#include "uart.h"
#include <avr/io.h>
#include <avr/interrupt.h>
void __attribute__ ((naked)) __attribute__ ((section (".init6"))) uart_tx_init() {
UCSRB |= (1<<TXEN);
}
void uart_putc(unsigned char c) {
while( ( UCSRA & ( 1 << UDRE ) ) == 0 ) {}
UDR = c;
}