[Top][All Lists]

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

Re: [avr-gcc-list] c library with stdio?

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] c library with stdio?
Date: Wed, 28 Aug 2002 18:38:47 +0200 (MET DST)

"Kurt Otte" <address@hidden> wrote:

> I am trying to port some code from other compilers to avr gcc.  The
> main hang up is library support for stdio functions.  So far this is
> my biggest issue with avr-gcc.

> Is there a new version of the library or an alternative that
> supports stdio?

Well, there's an old version :) that shipped with some experimental
stdio support.  You can still find the old versions on Marek's server
under http://www.amelek.gda.pl/avr/libc/  If you look into
e. g. avr-libc-20011208.tar.gz, you'll find a file named printf_P.zip.

The problem with a full-blown printf() is that it'll probably almost
fill up the entire ROM of a small device.  So it's usually better
to perform the task manually.  Also, since there's by now no common
notation of an IO device (in the sense of stdio's FILE *), it'll
become hard to support more than just the sprintf() & Co. functions.

A simple way to do actual IO is to have printf() doing its IO to some
imaginary user-supplied functions (e. g. the user is responsible to
supply a getc() and putc() primitive), but this one has the
disadvantage that you could only serve one IO channel in total.  So
it's probably better to hide the actual IO channel and its details
behind FILE *, but that requires a bit of consideration about how to
implement it without wasting too much memory for the underlying

J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/
avr-gcc-list at http://avr1.org

reply via email to

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