forked from bgiraut/SqueezeEsp32
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstRingBuffer.h
More file actions
38 lines (24 loc) · 814 Bytes
/
Copy pathstRingBuffer.h
File metadata and controls
38 lines (24 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef stRingBuffer_h
#define stRingBuffer_h
#include <Arduino.h>
class stRingBuffer
{
public :
stRingBuffer(uint32_t pBufferSize);
~stRingBuffer();
void PrintRingBuffer(uint32_t pSize);
bool isFreeSpace();
uint32_t dataSize();
uint32_t getBufferSize();
uint8_t readDataAt(uint16_t x);
void putData(uint8_t);
uint8_t getData();
void clearBuffer();
private :
uint32_t vcRingBufferSize; // Size of RingBuffer
uint8_t* vcRingBuffer; // RingBuffer
uint32_t vcRBcount; // Number of bytes in ringbuffer
uint32_t vcRBwindex = 0 ; // Fill pointer in ringbuffer
uint32_t vcRBrindex = vcRingBufferSize - 1 ; // Emptypointer in ringbuffer
};
#endif