Re: Interrupt driven UART
- From: James Beck <jim@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 19 Oct 2006 11:13:06 -0400
In article <12je2k41hk5or80@xxxxxxxxxxxxxxxxxx>,
ms@xxxxxxxxxxxxxxxxxxxxxxxxx says...
"galapogos" <goister@xxxxxxxxx> wrote in message
news:1161222525.036456.8350@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
James Beck wrote:
Don't confuse a FIFO with a circular queue.
Most UART drivers/ISR use a circular queue and just move pointers around
the like a loop. There will be times when the tail may point to a lower
memory location and also the other way around.
Jim
Yes I do realize it's a circular queue, I named the array fifo because
circular_queue was too long, but I've implemented it as a circular
queue in the code as you can see, by handling the wraparounds.
I maybe have missed something, but what exactly is the difference between a
FIFO and a circular queue?
Meindert
When I think of FIFO I think of a linear system, possibly hardware
based, that may or may not have "wrap around" in the memory pointer
sense. Like a stack that pushes on one end and pops at the other that
you may not be able manipulate the data pointer directly. I know I'm
splitting hairs and may not even be exactly correct in my thinking, but
when I mean a circular queue I say it.
In the end I was really just trying to point out that there will be
times when the pointers into the queue can wrap around at different
times and make doing simple math like
num_in_queue = queue_head - queue_tail
might not work right unless you take into account that when the head
pointer rolls back around before the tail pointer the answer is going to
wrap also. Not that it is a show stopper it just needs to be accounted
for.
Jim
.
- Follow-Ups:
- Re: Interrupt driven UART
- From: Meindert Sprang
- Re: Interrupt driven UART
- References:
- Interrupt driven UART
- From: goister@xxxxxxxxx
- Re: Interrupt driven UART
- From: Ico
- Re: Interrupt driven UART
- From: goister@xxxxxxxxx
- Re: Interrupt driven UART
- From: goister@xxxxxxxxx
- Re: Interrupt driven UART
- From: CBFalconer
- Re: Interrupt driven UART
- From: goister@xxxxxxxxx
- Re: Interrupt driven UART
- From: Mark Borgerson
- Re: Interrupt driven UART
- From: goister@xxxxxxxxx
- Re: Interrupt driven UART
- From: John B
- Re: Interrupt driven UART
- From: galapogos
- Re: Interrupt driven UART
- From: James Beck
- Re: Interrupt driven UART
- From: galapogos
- Re: Interrupt driven UART
- From: Meindert Sprang
- Interrupt driven UART
- Prev by Date: Re: Accessing global var of another file
- Next by Date: Re: Interrupt driven UART
- Previous by thread: Re: Interrupt driven UART
- Next by thread: Re: Interrupt driven UART
- Index(es):
Relevant Pages
|