Programa mbed1 excelencia
Dependencies: mbed
Diff: RingBuffer/Buffering.h
- Revision:
- 0:a5908bca4740
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RingBuffer/Buffering.h Wed Jan 18 12:58:15 2017 +0000 @@ -0,0 +1,30 @@ +#ifndef BUFFERING_H +#define BUFFERING_H + +#include "mbed.h" + +#define BUFFERSIZEBIG 300 +// Buffering de datos tipo float +class Buffering +{ +private: + unsigned char data[BUFFERSIZEBIG]; + unsigned int windex; + unsigned int rindex; + bool full; + bool empty; + unsigned int bufSize; +public: + Buffering(); + void put(unsigned char val); + unsigned char get(); + int getSize(); + bool isFull(); + bool isEmpty(); + unsigned int getWritingIndex(); + unsigned int getReadingIndex(); + unsigned int getDif(); +}; + +#endif // BUFFERING_H +