avr-firmwares/drivers/uart_tx.c

14 lines
304 B
C
Raw Normal View History

2018-01-29 20:29:02 +01:00
#include "uart_tx.h"
#include "uart.h"
#include <avr/io.h>
#include <avr/interrupt.h>
void __attribute__ ((naked)) __attribute__ ((section (".init6"))) uart_tx_init() {
UCSR0B |= (1<<TXEN0);
}
void uart_putc(unsigned char c) {
while( ( UCSR0A & ( 1 << UDRE0 ) ) == 0 ) {}
UDR0 = c;
}