Re: Where is the error (stdout)
Col <[email protected]> Sat, 8 Feb 2020 12:58:19 +1300
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Message-ID | <[email protected]> |
>
> 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;
}
Cheers
Colin