Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/13/07 07:06
Read: times


 
#137118 - Circular or Ring Buffer
Responding to: ???'s previous message
Craig Steiner said:
Just use a pointer to the next position in memory. When the pointer gets to the maximum buffer size, just wrap around. Thus you never clear memory but rather just keep wrapping around within the memory you've allocated as your buffer.

This technique is know as a "Circular Buffer" or "Ring Buffer" because of the way the pointer (or index) keeps wrapping around - in a circle (or ring).

This is an extremely powerful technique, and very commonly used in serial comms - especially interrupt-driven.
You would do well to get to know it!

Keil has an excellent example on their site - I have used it many times:
http://www.keil.com/download/docs/200.asp





List of 12 messages in thread
TopicAuthorDate
refreshing serial data            01/01/70 00:00      
   Other approach            01/01/70 00:00      
      Circular or Ring Buffer            01/01/70 00:00      
   A Yet More Clever Approach            01/01/70 00:00      
      the data isn't always consistent            01/01/70 00:00      
         PPP has maximum packet size            01/01/70 00:00      
         I know            01/01/70 00:00      
            here is why            01/01/70 00:00      
               not serious I hope            01/01/70 00:00      
         Doesn't PPP have a defined packet format?            01/01/70 00:00      
            mtu sizes            01/01/70 00:00      
   what do you mean????            01/01/70 00:00      

Back to Subject List