avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] interrupt-driven buffered UART receiver


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] interrupt-driven buffered UART receiver
Date: Tue, 11 Mar 2003 10:26:04 +0100 (MET)

"Alex Shepherd" <address@hidden> wrote:

> When I looked at the fdevopen() function it appears to malloc a
> little bit of memory, which then requires all the dynamic memory
> library which all adds to the foot print and took up too much FLASH
> in my Mega8 so I used something else.

Yes, it does.  How else would you provide a flexible implementation
that allows to open multiple parallel streams?  printf() is huge
anyway.

> If a usage combination that did not require dynamic memory was
> available, more potential use could be made of these functions.

I could perhaps pre-allocate the 3 standard streams (stdin, stdout,
stderr), but i remember that i tried this, and the overhead of
deciding whether a pre-allocated stream was going to be handled or
whether a user-opened stream almost outweighs the benefit.

In theory, you don't need fdevopen() at all as long as you provide a
valid FILE * (you cannot use stdin/stdout then and thus none of the
standard printf() & Co., you have to use fprintf() etc.).

For further discussions of this, please move the topic to the avr-libc
development list.  I'm open for any ideas that are compatible with the
current approach.  I think the option to have a flexible amount of
streams available is valuable, but i don't mind a small alternative if
people feel like that.

I agree that the useful device range for stdio currently starts at
devices with 16 KB of flash.
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/


reply via email to

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