[Top][All Lists]

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

Re: Where is the error (stdout)

From: David Kelly
Subject: Re: Where is the error (stdout)
Date: Fri, 7 Feb 2020 18:56:41 -0600

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.

reply via email to

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