[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where is the error (stdout)

From: Col
Subject: Re: Where is the error (stdout)
Date: Sat, 8 Feb 2020 12:58:19 +1300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

void uart_putchar(char c, FILE *stream)
 if (c == '\n')
uart_putchar('\r', stream);
 loop_until_bit_is_set(UCSRA, UDRE);
 UDR = c;
 return ;

I suspect it's because your returning a void instead of an int,

Here is some code that I used to test stdio on avrlibc ( atmega128 )

which compiles fine with gcc 5.4.0

static int uart_putchar(char c, FILE *stream)
    if (c == '\n')
        uart_putchar('\r', stream);
    loop_until_bit_is_set(UCSR0A, UDRE);
    UDR0 = c;
    return 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]