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: Andy Warner
Subject: Re: [avr-gcc-list] Problems with ATMEGA8 USART
Date: Tue, 16 Aug 2005 11:20:49 -0500
User-agent: Mutt/1.2.5i

David Kelly wrote:
> [...]
> You need to learn the basics of a circular buffer. Set aside a buffer  
> which will not be used by anything other than the receive side of the  
> serial port. Use two indexes into this buffer, I like to call them  
> "head" and "tail". Think of it as "food goes in at the head, comes  
> out the tail end."
> [excellent discussion of circular buffers deleted..]

Be warned that the head/tail usage can be something of a religious
war with people. There are those who champion the opposite roles
of head/tail, and remember it with "when you join a queue, should you
join at the head or the tail ?" - so if you inherit code, it is
always worth double checking which rule the author is following.

None of which negates any of David's description, it just swaps
the names of two variables.
-- 
address@hidden

Andy Warner             Voice: (612) 801-8549   Fax: (208) 575-5634




reply via email to

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