1
0
mirror of synced 2024-11-24 02:04:24 +01:00

Comments and whitespace.

This commit is contained in:
Mika Tuupola 2011-10-09 01:43:30 +03:00
parent 91025af29e
commit adae63b499
3 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@
* Led at Arduino digital 13 (PORTB5). Cause we all love blinken leds!
*
* To compile and upload run: make clean; make; make program;
* Connect to serial with: screen /dev/tty.usbserial-* 9600
*
* Copyright 2011 Mika Tuupola
*

View File

@ -13,7 +13,7 @@ void uart_init(void) {
UBRR0L = UBRRL_VALUE;
UCSR0C = _BV(UCSZ01) | _BV(UCSZ00); /* 8-bit data */
UCSR0B = _BV(RXEN0) | _BV(TXEN0); /* Enable RX and TX */
UCSR0B = _BV(RXEN0) | _BV(TXEN0); /* Enable RX and TX */
}
int uart_putchar(char c, FILE *stream) {
@ -30,3 +30,4 @@ int uart_getchar(FILE *stream) {
return UDR0;
}

View File

@ -3,5 +3,7 @@ int 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);
FILE uart_input = FDEV_SETUP_STREAM(NULL, uart_getchar, _FDEV_SETUP_READ);