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

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

Re: [avr-gcc-list] Problems with ATMEGA8 USART


From: Bob Paddock
Subject: Re: [avr-gcc-list] Problems with ATMEGA8 USART
Date: Sun, 14 Aug 2005 05:21:00 -0400
User-agent: KMail/1.7.2

On Saturday 13 August 2005 08:35 pm, David Kelly wrote:
> On Aug 13, 2005, at 3:08 PM, juan antonio jimenez martinez wrote:

> For advanced discussion one would probably wish to put the buffer and
> its indexes into a struct so that its obvious to future generations
> maintaining your code that the indexes and buffer belong together.
> Doesn't make code size one iota bigger:
>
> struct {
>      uint8_t tail;
>      volatile uint8_t head, buffer[BUFFER_SIZE];
> } uart0;

On the Mega162 with two USARTs I tried it both ways.  Duplicate the code for 
each USART, and using a common driver with structures.  The duplicate 
approach came out smaller in code space.  Don't recall the exact number but 
it was more than a few bytes of difference.




reply via email to

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