publish libraries to avoid users to have to download them one by one
This commit is contained in:
1 parent
93c075e880
commit
f0546fab8c
396 files changed
+536928
No files matched your search
@@ -0,0 +1,33 @@
|
||||
#ifndef CIRCULARBUFFER_H
|
||||
#define CIRCULARBUFFER_H
|
||||
#include <stdint.h>
|
||||
|
||||
//****************************************************************************//
|
||||
//
|
||||
// Circular Buffer
|
||||
//
|
||||
//****************************************************************************//
|
||||
|
||||
//Class CircularBuffer is int16_t
|
||||
//Does not care about over-running real data ( if request is outside length's bounds ).
|
||||
//For example, the underlying machine writes [48], [49], [0], [1] ...
|
||||
|
||||
class CircularBuffer
|
||||
{
|
||||
public:
|
||||
CircularBuffer( uint16_t inputSize );
|
||||
~CircularBuffer();
|
||||
float getElement( uint16_t ); //zero is the push location
|
||||
void pushElement( float );
|
||||
float averageLast( uint16_t );
|
||||
uint16_t recordLength( void );
|
||||
private:
|
||||
uint16_t cBufferSize;
|
||||
float *cBufferData;
|
||||
int16_t cBufferLastPtr;
|
||||
uint8_t cBufferElementsUsed;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // CIRCULARBUFFER_H
|
||||
Reference in new issue
Block a user