base: Rewrite the CircleBuf to fix bugs and add serialization
Review Request #2940 - Created July 7, 2015 and submitted
Changeset 10919:eef3b986946a --------------------------- base: Rewrite the CircleBuf to fix bugs and add serialization The CircleBuf class has at least one bug causing it to overwrite the wrong elements when wrapping. The current code has a lot of unused functionality and duplicated code. This changeset replaces the old implementation with a new version that supports serialization and arbitrary types in the buffer (not just char).
Tested with unit test that exercises all corner cases (different buffer wrap arounds etc.). Used extensively as a FIFO for the DMA engine in RB2942. All regressions pass, but some terminal outputs change since buffer wraparounds now work correctly.