Comments and whitespace.
This commit is contained in:
parent
91025af29e
commit
adae63b499
@ -5,6 +5,7 @@
|
|||||||
* Led at Arduino digital 13 (PORTB5). Cause we all love blinken leds!
|
* Led at Arduino digital 13 (PORTB5). Cause we all love blinken leds!
|
||||||
*
|
*
|
||||||
* To compile and upload run: make clean; make; make program;
|
* To compile and upload run: make clean; make; make program;
|
||||||
|
* Connect to serial with: screen /dev/tty.usbserial-* 9600
|
||||||
*
|
*
|
||||||
* Copyright 2011 Mika Tuupola
|
* Copyright 2011 Mika Tuupola
|
||||||
*
|
*
|
||||||
|
@ -13,7 +13,7 @@ void uart_init(void) {
|
|||||||
UBRR0L = UBRRL_VALUE;
|
UBRR0L = UBRRL_VALUE;
|
||||||
|
|
||||||
UCSR0C = _BV(UCSZ01) | _BV(UCSZ00); /* 8-bit data */
|
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) {
|
int uart_putchar(char c, FILE *stream) {
|
||||||
@ -30,3 +30,4 @@ int uart_getchar(FILE *stream) {
|
|||||||
return UDR0;
|
return UDR0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,5 +3,7 @@ int uart_getchar(FILE *stream);
|
|||||||
|
|
||||||
void uart_init(void);
|
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_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);
|
||||||
|
Loading…
Reference in New Issue
Block a user