comp.lang.ada
 help / color / mirror / Atom feed
From: Frank Buss <fb@frank-buss.de>
Subject: FIFO
Date: Sat, 16 Sep 2017 17:24:18 +0200
Date: 2017-09-16T17:24:18+02:00	[thread overview]
Message-ID: <opjfn2$bid$1@newsreader4.netcologne.de> (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


             reply	other threads:[~2017-09-16 15:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-16 15:24 Frank Buss [this message]
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
replies disabled

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