1
0
mirror of synced 2024-12-12 10:46:26 +01:00

adding extern to FILE variables

This commit is contained in:
Ben Morse 2015-02-19 00:22:51 -08:00
parent 93ac6d434f
commit 4003dd5267
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 */ /* 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) { void uart_init(void) {
UBRR0H = UBRRH_VALUE; UBRR0H = UBRRH_VALUE;
UBRR0L = UBRRL_VALUE; UBRR0L = UBRRL_VALUE;

View File

@ -5,5 +5,5 @@ void uart_init(void);
/* http://www.ermicro.com/blog/?p=325 */ /* http://www.ermicro.com/blog/?p=325 */
FILE uart_output = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE); extern FILE uart_output;
FILE uart_input = FDEV_SETUP_STREAM(NULL, uart_getchar, _FDEV_SETUP_READ); extern FILE uart_input;

View File

@ -8,5 +8,5 @@ struct tx_ring;
/* http://www.ermicro.com/blog/?p=325 */ /* http://www.ermicro.com/blog/?p=325 */
FILE uart_output = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE); extern FILE uart_output;
FILE uart_input = FDEV_SETUP_STREAM(NULL, uart_getchar, _FDEV_SETUP_READ); extern FILE uart_input;

View File

@ -32,6 +32,10 @@ struct rx_ring {
static struct tx_ring tx_buffer; static struct tx_ring tx_buffer;
static struct rx_ring rx_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 */ /* http://www.cs.mun.ca/~rod/Winter2007/4723/notes/serial/serial.html */
void uart_init(void) { void uart_init(void) {