auto-sync
This commit is contained in:
parent
5732ac2092
commit
fd95ec0008
|
@ -12,10 +12,15 @@
|
||||||
#include "cyclic_buffer.h"
|
#include "cyclic_buffer.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
cyclic_buffer::cyclic_buffer() : cyclic_buffer(CB_MAX_SIZE) {
|
cyclic_buffer::cyclic_buffer() {
|
||||||
|
baseC(CB_MAX_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
cyclic_buffer::cyclic_buffer(int size) {
|
cyclic_buffer::cyclic_buffer(int size) {
|
||||||
|
baseC(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cyclic_buffer::baseC(int size) {
|
||||||
currentIndex = 0;
|
currentIndex = 0;
|
||||||
setSize(size);
|
setSize(size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ class cyclic_buffer
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void baseC(int size);
|
||||||
volatile int elements[CB_MAX_SIZE];
|
volatile int elements[CB_MAX_SIZE];
|
||||||
volatile int currentIndex;
|
volatile int currentIndex;
|
||||||
volatile int count;
|
volatile int count;
|
||||||
|
|
Loading…
Reference in New Issue