remove unneeded crap

This commit is contained in:
Matt Harlum 2015-02-11 23:55:03 +11:00
parent 958e52e0e2
commit d697d83989
3 changed files with 0 additions and 49 deletions

40
uart.c
View File

@ -1,40 +0,0 @@
#include <avr/io.h>
#include <stdio.h>
#ifndef F_CPU
#define F_CPU 16000000UL
#endif
#ifndef BAUD
#define BAUD 19200
#endif
#include <util/setbaud.h>
/* http://www.cs.mun.ca/~rod/Winter2007/4723/notes/serial/serial.html */
void uart_init(void) {
UBRR0H = UBRRH_VALUE;
UBRR0L = UBRRL_VALUE;
#if USE_2X
UCSR0A |= _BV(U2X0);
#else
UCSR0A &= ~(_BV(U2X0));
#endif
UCSR0C = _BV(UCSZ01) | _BV(UCSZ00); /* 8-bit data */
UCSR0B = _BV(RXEN0) | _BV(TXEN0); /* Enable RX and TX */
}
void uart_putchar(char c, FILE *stream) {
if (c == '\n') {
uart_putchar('\r', stream);
}
loop_until_bit_is_set(UCSR0A, UDRE0);
UDR0 = c;
}
char uart_getchar(FILE *stream) {
loop_until_bit_is_set(UCSR0A, RXC0);
return UDR0;
}

1
uart.d
View File

@ -1 +0,0 @@
uart.o uart.d : uart.c

8
uart.h
View File

@ -1,8 +0,0 @@
void uart_putchar(char c, FILE *stream);
char uart_getchar(FILE *stream);
void uart_init(void);
/* http://www.ermicro.com/blog/?p=325 */
FILE uart_output = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);
FILE uart_input = FDEV_SETUP_STREAM(NULL, uart_getchar, _FDEV_SETUP_READ);