auto-sync

This commit is contained in:
rusEfi 2015-03-25 20:07:56 -05:00
parent 5732ac2092
commit fd95ec0008
2 changed files with 7 additions and 1 deletions

View File

@ -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);
} }

View File

@ -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;