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