Skip to content

Commit

Permalink
Clear quadBaseBuffers array before updating settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiegle committed Apr 26, 2024
1 parent 16b4cb2 commit 55aca16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Source/NeuropixThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ void NeuropixThread::updateStreamInfo()
}
else {

probe->quadBaseBuffers.clear();

for (int shank = 0; shank < 4; shank++)
{
StreamInfo apInfo;
Expand All @@ -396,10 +398,9 @@ void NeuropixThread::updateStreamInfo()
streamInfo.add(apInfo);

sourceBuffers.add(new DataBuffer(apInfo.num_channels, 460800)); // AP band buffer

probe->quadBaseBuffers.add(sourceBuffers.getLast());

std::cout << probe->quadBaseBuffers[shank] << std::endl;

LOGD("Probe (slot=", probe->basestation->slot, ", port=", probe->headstage->port, ") SHANK=", shank +1," CH = ", 384, " SR = ", apInfo.sample_rate, " Hz");

}
Expand Down
5 changes: 2 additions & 3 deletions Source/Probes/Neuropixels_QuadBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Neuropixels_QuadBase::Neuropixels_QuadBase(Basestation* bs, Headstage* hs, Flex*

customName.probeSpecific = String(info.serial_number);

acquisitionThreads.clear();

LOGC("Trying to open probe, slot: ", basestation->slot, " port: ", headstage->port, " dock: ", dock);

if (Geometry::forPartNumber(info.part_number, electrodeMetadata, probeMetadata))
Expand Down Expand Up @@ -615,7 +617,6 @@ void Neuropixels_QuadBase::startAcquisition()
for (int shank = 0; shank < 4; shank++)
{

std::cout << quadBaseBuffers[shank] << std::endl;
quadBaseBuffers[shank]->clear();

acquisitionThreads.add(
Expand Down Expand Up @@ -680,7 +681,6 @@ AcquisitionThread::AcquisitionThread(
else if (shank == 3)
stream_source = Neuropixels::streamsource_t::SourceSt3;

std::cout << "AcquisitionThread: " << buffer << std::endl;
}

void AcquisitionThread::run()
Expand Down Expand Up @@ -769,7 +769,6 @@ void AcquisitionThread::run()
std::cout << "readPackets error code: " << errorCode << " for Basestation " << slot << ", probe " << port << std::endl;
}


buffer->addToBuffer(apSamples, ap_timestamps, timestamp_s, event_codes, packet_count);

if (!passedOneSecond)
Expand Down

0 comments on commit 55aca16

Please sign in to comment.