WavPlayer.h changed to circuit board
Dependents: WavPlayerSD WavPlayerUSB WavPlayerUSB WavPlayerSD_CB
Diff: RingBuffer/RingBuffer.h
- Revision:
- 0:3695886f3495
diff -r 000000000000 -r 3695886f3495 RingBuffer/RingBuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RingBuffer/RingBuffer.h Wed Sep 19 10:58:16 2012 +0000 @@ -0,0 +1,44 @@ +#ifndef RINGBUFFER_H +#define RINGBUFFER_H + +#include "mbed.h" + +#define RBLENGTH 1000 +#define RBWIDTH 2 + +class RingBuffer { + +public: + +RingBuffer(); + +int addToBuffer(int* input); +int addToBufferS(int input, int across); +int nextBuffer(); + +void readFirst(int* output); +int readFirstS(int across); + +void readAt(int* output, int at); +int readAtS(int at, int across); + +void readLast(int*output); +int readLastS(int across); + +void usedFirst(); +void usedLast(); + +int numberStored(); + +protected: + +int16_t Buffer[RBLENGTH][RBWIDTH]; + +int Start; +int Finish; +int Samples; + +void sortFinishNS(); +void sortStartUS(); +}; +#endif \ No newline at end of file