comp.lang.ada
 help / color / mirror / Atom feed
* FIFO
@ 2017-09-16 15:24 Frank Buss
  2017-09-16 16:19 ` FIFO Jacob Sparre Andersen
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Frank Buss @ 2017-09-16 15:24 UTC (permalink / raw)


I need a FIFO with a fixed size, for buffering serial data on an 
embedded system. The FIFO will be filled in an interrupt and read from 
the main function.

I guess I could implement this myself, using a simple array of e.g. 256 
bytes, and then a read index and a write index. If I specify it with 
"pragma Volatile", nothing bad should happen.

But I read about bounded vectors. Could I use this as well and save a 
few lines of code and testing work? I'm a bit worried about if the 
behavior is standardized, such that e.g. Delete_First doesn't physically 
move all elements, because this would be bad when writing it at the same 
time from the interrupt. Because it is bounded, it could be implemented 
as the simple ringbuffer as I would implement it.

-- 
Frank Buss, http://www.frank-buss.de
electronics and more: http://www.youtube.com/user/frankbuss


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-09-25 20:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-16 15:24 FIFO Frank Buss
2017-09-16 16:19 ` FIFO Jacob Sparre Andersen
2017-09-16 17:07   ` FIFO Dmitry A. Kazakov
2017-09-16 17:12   ` FIFO Frank Buss
2017-09-16 17:22     ` FIFO Dmitry A. Kazakov
2017-09-16 18:32       ` FIFO Frank Buss
2017-09-17  7:39         ` FIFO Jacob Sparre Andersen
2017-09-17  8:38           ` FIFO Jacob Sparre Andersen
2017-09-17  8:57           ` FIFO Niklas Holsti
2017-09-17 11:30         ` FIFO AdaMagica
     [not found]           ` <8b99f47a-63bf-4f07-9077-6dab3cf32a7f@googlegroups.com>
     [not found]             ` <oppbcq$7jj$1@newsreader4.netcologne.de>
     [not found]               ` <d37417dd-3a94-4a43-bc9c-071f2da6181d@googlegroups.com>
     [not found]                 ` <f2bs2lFq4j3U1@mid.individual.net>
     [not found]                   ` <opqq32$3bd$1@newsreader4.netcologne.de>
2017-09-25 20:57                     ` FIFO Niklas Holsti
2017-09-16 17:52 ` FIFO Robert A Duff
2017-09-16 18:11   ` FIFO Frank Buss
2017-09-17  9:46   ` FIFO Simon Wright
2017-09-16 22:04 ` FIFO Jeffrey R. Carter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox