Skip to content

Commit

Permalink
Merge pull request #20 from OpenBCI/fix-restarting-data-steam-bug
Browse files Browse the repository at this point in the history
Fix restarting data steam bug
  • Loading branch information
philippitts authored Aug 18, 2023
2 parents fc8f2ba + 98390e7 commit 146fe18
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions OpenBCI_Ganglion_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void OpenBCI_Ganglion::makeUniqueId() {
SimbleeBLE.manufacturerName = "openbci.com";
SimbleeBLE.modelNumber = "Ganglion";
SimbleeBLE.hardwareRevision = "1.0.1";
SimbleeBLE.softwareRevision = "3.0.0";
SimbleeBLE.softwareRevision = "3.0.1";
}

void OpenBCI_Ganglion::blinkLED() {
Expand Down Expand Up @@ -131,6 +131,7 @@ boolean OpenBCI_Ganglion::startRunning(void) {
}
is_running = true;
sampleCounter = 0xFF;
ringBufferLevel = 0xFF;
if (streamSynthetic) {
for (int i = 1; i < 4; i++) {
channelData[i] = 0;
Expand Down Expand Up @@ -239,9 +240,9 @@ void OpenBCI_Ganglion::incrementSyntheticChannelData() {
for (int i = 0; i < 4; i++) {
rising[i] = !rising[i];
if (rising[i]) {
channelData[i] = 8000;
channelData[i] = 8000000;
} else {
channelData[i] = -8000;
channelData[i] = -8000000;
}
}
}
Expand Down Expand Up @@ -930,7 +931,7 @@ boolean OpenBCI_Ganglion::eventSerial() {
if (bufferLevelCounter == bufferLevel + 1) { // when we send all the packets
serialBytesToSend = false; // put down bufferToSend flag
bufferLevel = 0; // initialize bufferLevel
initSerialBuffer(); // initialize bufffer
initSerialBuffer(); // initialize buffer
}
timeLastPacketSent = millis();
}
Expand All @@ -943,7 +944,7 @@ boolean OpenBCI_Ganglion::eventSerial() {
}
serialBytesToSend = false; // put down bufferToSend flag
bufferLevel = 0; // initialize bufferLevel
initSerialBuffer(); // initialize bufffer
initSerialBuffer(); // initialize buffer
}
}

Expand Down

0 comments on commit 146fe18

Please sign in to comment.