mirror of
1
0
Fork 0

Merge pull request #1 from esromneb/master

Add extern to FILE variables
This commit is contained in:
Mika Tuupola 2015-02-19 17:20:21 +08:00
commit 605bfd3d65
4 changed files with 11 additions and 4 deletions

View File

@ -8,6 +8,9 @@
/* http://www.cs.mun.ca/~rod/Winter2007/4723/notes/serial/serial.html */
FILE uart_output = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);
FILE uart_input = FDEV_SETUP_STREAM(NULL, uart_getchar, _FDEV_SETUP_READ);
void uart_init(void) {
UBRR0H = UBRRH_VALUE;
UBRR0L = UBRRL_VALUE;

View File

@ -5,5 +5,5 @@ 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);
extern FILE uart_output;
extern FILE uart_input;

View File

@ -8,5 +8,5 @@ struct tx_ring;
/* 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);
extern FILE uart_output;
extern FILE uart_input;

View File

@ -32,6 +32,10 @@ struct rx_ring {
static struct tx_ring tx_buffer;
static struct rx_ring rx_buffer;
FILE uart_output = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);
FILE uart_input = FDEV_SETUP_STREAM(NULL, uart_getchar, _FDEV_SETUP_READ);
/* http://www.cs.mun.ca/~rod/Winter2007/4723/notes/serial/serial.html */
void uart_init(void) {