Send AVR-GCC-list mailing list submissions to
address@hidden
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
or, via email, send a message with subject or body 'help' to
address@hidden
You can reach the person managing the list at
address@hidden
When replying, please edit your Subject line so it is more specific
than "Re: Contents of AVR-GCC-list digest..."
Today's Topics:
1. Re: Where is the error (stdout) (Col)
2. Re: Where is the error (stdout) (David Kelly)
----------------------------------------------------------------------
Message: 1
Date: Sat, 8 Feb 2020 12:58:19 +1300
From: Col <address@hidden>
To: address@hidden
Subject: Re: Where is the error (stdout)
Message-ID: <address@hidden>
Content-Type: text/plain; charset=utf-8; format=flowed
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
------------------------------
Message: 2
Date: Fri, 7 Feb 2020 18:56:41 -0600
From: David Kelly <address@hidden>
To: address@hidden
Subject: Re: Where is the error (stdout)
Message-ID: <address@hidden>
Content-Type: text/plain; charset=us-ascii
On Feb 7, 2020, at 5:58 PM, Col <address@hidden> wrote:
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,
In Unix convention its
int putc( int, FILE* )
int putchar( int )
Where upon success one returns the character put or -1 or EOF for failure. If
replacing standard function one should return the expected value else something
will break.
--
David Kelly N4HHE, address@hidden
============================================================
Whom computers would destroy, they must first drive mad.
------------------------------
Subject: Digest Footer
_______________________________________________
AVR-GCC-list mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
------------------------------
End of AVR-GCC-list Digest, Vol 157, Issue 2
********************************************