Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: circularBuff.h
- Revision:
- 0:f6f6750994d2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/circularBuff.h Fri May 17 13:06:31 2019 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" + +#ifndef CIRCULARBUFF_H +#define CIRCULARBUF_H + +typedef struct { + uint8_t *buffer; + size_t head; + size_t tail; + size_t size; //of the buffer +} circ_buf_t; + +int circ_buf_rst(circ_buf_t * cbuf); +int circ_buf_put(circ_buf_t * cbuf, uint8_t data); +int circ_buf_get(circ_buf_t * cbuf, uint8_t * data); +bool circ_buf_empty(circ_buf_t cbuf); +bool circ_buf_full(circ_buf_t cbuf); + +#endif \ No newline at end of file