circular buffer library for 8-bit microcontroller